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

Side by Side Diff: webrtc/modules/congestion_controller/delay_based_bwe.cc

Issue 2086633002: Revert of Remove audio/video distinction for probe packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 new_bitrate_bps > static_cast<int>(remote_rate_.LatestEstimate()); 191 new_bitrate_bps > static_cast<int>(remote_rate_.LatestEstimate());
192 return initial_probe || bitrate_above_estimate; 192 return initial_probe || bitrate_above_estimate;
193 } 193 }
194 194
195 void DelayBasedBwe::IncomingPacketFeedbackVector( 195 void DelayBasedBwe::IncomingPacketFeedbackVector(
196 const std::vector<PacketInfo>& packet_feedback_vector) { 196 const std::vector<PacketInfo>& packet_feedback_vector) {
197 RTC_DCHECK(network_thread_.CalledOnValidThread()); 197 RTC_DCHECK(network_thread_.CalledOnValidThread());
198 for (const auto& packet_info : packet_feedback_vector) { 198 for (const auto& packet_info : packet_feedback_vector) {
199 IncomingPacketInfo(packet_info.arrival_time_ms, 199 IncomingPacketInfo(packet_info.arrival_time_ms,
200 ConvertMsTo24Bits(packet_info.send_time_ms), 200 ConvertMsTo24Bits(packet_info.send_time_ms),
201 packet_info.payload_size, 0, 201 packet_info.payload_size, 0, packet_info.was_paced,
202 packet_info.probe_cluster_id); 202 packet_info.probe_cluster_id);
203 } 203 }
204 } 204 }
205 205
206 void DelayBasedBwe::IncomingPacket(int64_t arrival_time_ms, 206 void DelayBasedBwe::IncomingPacket(int64_t arrival_time_ms,
207 size_t payload_size, 207 size_t payload_size,
208 const RTPHeader& header) { 208 const RTPHeader& header,
209 bool was_paced) {
209 RTC_DCHECK(network_thread_.CalledOnValidThread()); 210 RTC_DCHECK(network_thread_.CalledOnValidThread());
210 if (!header.extension.hasAbsoluteSendTime) { 211 if (!header.extension.hasAbsoluteSendTime) {
211 // NOTE! The BitrateEstimatorTest relies on this EXACT log line. 212 // NOTE! The BitrateEstimatorTest relies on this EXACT log line.
212 LOG(LS_WARNING) << "RemoteBitrateEstimatorAbsSendTime: Incoming packet " 213 LOG(LS_WARNING) << "RemoteBitrateEstimatorAbsSendTime: Incoming packet "
213 "is missing absolute send time extension!"; 214 "is missing absolute send time extension!";
214 return; 215 return;
215 } 216 }
216 IncomingPacketInfo(arrival_time_ms, header.extension.absoluteSendTime, 217 IncomingPacketInfo(arrival_time_ms, header.extension.absoluteSendTime,
217 payload_size, header.ssrc, PacketInfo::kNotAProbe); 218 payload_size, header.ssrc, was_paced,
219 PacketInfo::kNotAProbe);
218 } 220 }
219 221
220 void DelayBasedBwe::IncomingPacket(int64_t arrival_time_ms, 222 void DelayBasedBwe::IncomingPacket(int64_t arrival_time_ms,
221 size_t payload_size, 223 size_t payload_size,
222 const RTPHeader& header, 224 const RTPHeader& header,
225 bool was_paced,
223 int probe_cluster_id) { 226 int probe_cluster_id) {
224 RTC_DCHECK(network_thread_.CalledOnValidThread()); 227 RTC_DCHECK(network_thread_.CalledOnValidThread());
225 if (!header.extension.hasAbsoluteSendTime) { 228 if (!header.extension.hasAbsoluteSendTime) {
226 // NOTE! The BitrateEstimatorTest relies on this EXACT log line. 229 // NOTE! The BitrateEstimatorTest relies on this EXACT log line.
227 LOG(LS_WARNING) << "RemoteBitrateEstimatorAbsSendTime: Incoming packet " 230 LOG(LS_WARNING) << "RemoteBitrateEstimatorAbsSendTime: Incoming packet "
228 "is missing absolute send time extension!"; 231 "is missing absolute send time extension!";
229 return; 232 return;
230 } 233 }
231 IncomingPacketInfo(arrival_time_ms, header.extension.absoluteSendTime, 234 IncomingPacketInfo(arrival_time_ms, header.extension.absoluteSendTime,
232 payload_size, header.ssrc, probe_cluster_id); 235 payload_size, header.ssrc, was_paced, probe_cluster_id);
233 } 236 }
234 237
235 void DelayBasedBwe::IncomingPacketInfo(int64_t arrival_time_ms, 238 void DelayBasedBwe::IncomingPacketInfo(int64_t arrival_time_ms,
236 uint32_t send_time_24bits, 239 uint32_t send_time_24bits,
237 size_t payload_size, 240 size_t payload_size,
238 uint32_t ssrc, 241 uint32_t ssrc,
242 bool was_paced,
239 int probe_cluster_id) { 243 int probe_cluster_id) {
240 assert(send_time_24bits < (1ul << 24)); 244 assert(send_time_24bits < (1ul << 24));
241 // Shift up send time to use the full 32 bits that inter_arrival works with, 245 // Shift up send time to use the full 32 bits that inter_arrival works with,
242 // so wrapping works properly. 246 // so wrapping works properly.
243 uint32_t timestamp = send_time_24bits << kAbsSendTimeInterArrivalUpshift; 247 uint32_t timestamp = send_time_24bits << kAbsSendTimeInterArrivalUpshift;
244 int64_t send_time_ms = static_cast<int64_t>(timestamp) * kTimestampToMs; 248 int64_t send_time_ms = static_cast<int64_t>(timestamp) * kTimestampToMs;
245 249
246 int64_t now_ms = arrival_time_ms; 250 int64_t now_ms = arrival_time_ms;
247 // TODO(holmer): SSRCs are only needed for REMB, should be broken out from 251 // TODO(holmer): SSRCs are only needed for REMB, should be broken out from
248 // here. 252 // here.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 return true; 397 return true;
394 } 398 }
395 399
396 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { 400 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) {
397 // Called from both the configuration thread and the network thread. Shouldn't 401 // Called from both the configuration thread and the network thread. Shouldn't
398 // be called from the network thread in the future. 402 // be called from the network thread in the future.
399 rtc::CritScope lock(&crit_); 403 rtc::CritScope lock(&crit_);
400 remote_rate_.SetMinBitrate(min_bitrate_bps); 404 remote_rate_.SetMinBitrate(min_bitrate_bps);
401 } 405 }
402 } // namespace webrtc 406 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698