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

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

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

Powered by Google App Engine
This is Rietveld 408576698