Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc

Issue 2112643005: Remove audio/video distinction for probe packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@52
Patch Set: rebase errors Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 last_acked_seq_num_ = packet_feedback_vector.back().sequence_number; 86 last_acked_seq_num_ = packet_feedback_vector.back().sequence_number;
87 has_received_ack_ = true; 87 has_received_ack_ = true;
88 } 88 }
89 } 89 }
90 90
91 void FullBweSender::OnPacketsSent(const Packets& packets) { 91 void FullBweSender::OnPacketsSent(const Packets& packets) {
92 for (Packet* packet : packets) { 92 for (Packet* packet : packets) {
93 if (packet->GetPacketType() == Packet::kMedia) { 93 if (packet->GetPacketType() == Packet::kMedia) {
94 MediaPacket* media_packet = static_cast<MediaPacket*>(packet); 94 MediaPacket* media_packet = static_cast<MediaPacket*>(packet);
95 send_time_history_.AddAndRemoveOld(media_packet->header().sequenceNumber, 95 send_time_history_.AddAndRemoveOld(media_packet->header().sequenceNumber,
96 media_packet->payload_size(), 96 media_packet->payload_size());
97 packet->paced());
98 send_time_history_.OnSentPacket(media_packet->header().sequenceNumber, 97 send_time_history_.OnSentPacket(media_packet->header().sequenceNumber,
99 media_packet->sender_timestamp_ms()); 98 media_packet->sender_timestamp_ms());
100 } 99 }
101 } 100 }
102 } 101 }
103 102
104 void FullBweSender::OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, 103 void FullBweSender::OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
105 uint32_t bitrate) { 104 uint32_t bitrate) {
106 feedback_observer_->OnReceivedEstimatedBitrate(bitrate); 105 feedback_observer_->OnReceivedEstimatedBitrate(bitrate);
107 } 106 }
(...skipping 11 matching lines...) Expand all
119 : BweReceiver(flow_id), last_feedback_ms_(0) { 118 : BweReceiver(flow_id), last_feedback_ms_(0) {
120 } 119 }
121 120
122 SendSideBweReceiver::~SendSideBweReceiver() { 121 SendSideBweReceiver::~SendSideBweReceiver() {
123 } 122 }
124 123
125 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms, 124 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms,
126 const MediaPacket& media_packet) { 125 const MediaPacket& media_packet) {
127 packet_feedback_vector_.push_back(PacketInfo( 126 packet_feedback_vector_.push_back(PacketInfo(
128 -1, arrival_time_ms, media_packet.sender_timestamp_ms(), 127 -1, arrival_time_ms, media_packet.sender_timestamp_ms(),
129 media_packet.header().sequenceNumber, media_packet.payload_size(), true)); 128 media_packet.header().sequenceNumber, media_packet.payload_size()));
130 129
131 // Log received packet information. 130 // Log received packet information.
132 BweReceiver::ReceivePacket(arrival_time_ms, media_packet); 131 BweReceiver::ReceivePacket(arrival_time_ms, media_packet);
133 } 132 }
134 133
135 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) { 134 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) {
136 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs) 135 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs)
137 return NULL; 136 return NULL;
138 last_feedback_ms_ = now_ms; 137 last_feedback_ms_ = now_ms;
139 int64_t corrected_send_time_ms = 138 int64_t corrected_send_time_ms =
140 packet_feedback_vector_.back().send_time_ms + now_ms - 139 packet_feedback_vector_.back().send_time_ms + now_ms -
141 packet_feedback_vector_.back().arrival_time_ms; 140 packet_feedback_vector_.back().arrival_time_ms;
142 FeedbackPacket* fb = new SendSideBweFeedback( 141 FeedbackPacket* fb = new SendSideBweFeedback(
143 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); 142 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_);
144 packet_feedback_vector_.clear(); 143 packet_feedback_vector_.clear();
145 return fb; 144 return fb;
146 } 145 }
147 146
148 } // namespace bwe 147 } // namespace bwe
149 } // namespace testing 148 } // namespace testing
150 } // namespace webrtc 149 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc ('k') | webrtc/modules/remote_bitrate_estimator/test/packet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698