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

Side by Side Diff: webrtc/call/call.cc

Issue 2653883002: Set the start bitrate to the delay-based BWE. (Closed)
Patch Set: Add test. Created 3 years, 10 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
« no previous file with comments | « no previous file | webrtc/call/rampup_tests.h » ('j') | webrtc/call/rampup_tests.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 this, 300 this,
301 &remb_, 301 &remb_,
302 event_log_, 302 event_log_,
303 &packet_router_)), 303 &packet_router_)),
304 video_send_delay_stats_(new SendDelayStats(clock_)), 304 video_send_delay_stats_(new SendDelayStats(clock_)),
305 start_ms_(clock_->TimeInMilliseconds()), 305 start_ms_(clock_->TimeInMilliseconds()),
306 worker_queue_("call_worker_queue") { 306 worker_queue_("call_worker_queue") {
307 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); 307 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
308 RTC_DCHECK(config.event_log != nullptr); 308 RTC_DCHECK(config.event_log != nullptr);
309 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); 309 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0);
310 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, 310 RTC_DCHECK_GT(config.bitrate_config.start_bitrate_bps,
terelius 2017/01/24 16:05:52 Why not DCHECK_GE? That seems more natural to me.
stefan-webrtc 2017/01/24 16:29:43 It's just a bit unclear to me why you'd want to st
terelius 2017/01/25 16:41:27 Ok, I see. Is there a reason for allowing min_bitr
stefan-webrtc 2017/01/27 09:27:05 Good question. It will immediately get clamped her
311 config.bitrate_config.min_bitrate_bps); 311 config.bitrate_config.min_bitrate_bps);
312 if (config.bitrate_config.max_bitrate_bps != -1) { 312 if (config.bitrate_config.max_bitrate_bps != -1) {
313 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, 313 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps,
314 config.bitrate_config.start_bitrate_bps); 314 config.bitrate_config.start_bitrate_bps);
315 } 315 }
316 Trace::CreateTrace(); 316 Trace::CreateTrace();
317 call_stats_->RegisterStatsObserver(congestion_controller_.get()); 317 call_stats_->RegisterStatsObserver(congestion_controller_.get());
318 318
319 congestion_controller_->SignalNetworkState(kNetworkDown); 319 congestion_controller_->SignalNetworkState(kNetworkDown);
320 congestion_controller_->SetBweBitrates( 320 congestion_controller_->SetBweBitrates(
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 bitrate_config.max_bitrate_bps) { 809 bitrate_config.max_bitrate_bps) {
810 // Nothing new to set, early abort to avoid encoder reconfigurations. 810 // Nothing new to set, early abort to avoid encoder reconfigurations.
811 return; 811 return;
812 } 812 }
813 config_.bitrate_config.min_bitrate_bps = bitrate_config.min_bitrate_bps; 813 config_.bitrate_config.min_bitrate_bps = bitrate_config.min_bitrate_bps;
814 // Start bitrate of -1 means we should keep the old bitrate, which there is 814 // Start bitrate of -1 means we should keep the old bitrate, which there is
815 // no point in remembering for the future. 815 // no point in remembering for the future.
816 if (bitrate_config.start_bitrate_bps > 0) 816 if (bitrate_config.start_bitrate_bps > 0)
817 config_.bitrate_config.start_bitrate_bps = bitrate_config.start_bitrate_bps; 817 config_.bitrate_config.start_bitrate_bps = bitrate_config.start_bitrate_bps;
818 config_.bitrate_config.max_bitrate_bps = bitrate_config.max_bitrate_bps; 818 config_.bitrate_config.max_bitrate_bps = bitrate_config.max_bitrate_bps;
819 RTC_DCHECK_NE(bitrate_config.start_bitrate_bps, 0);
819 congestion_controller_->SetBweBitrates(bitrate_config.min_bitrate_bps, 820 congestion_controller_->SetBweBitrates(bitrate_config.min_bitrate_bps,
820 bitrate_config.start_bitrate_bps, 821 bitrate_config.start_bitrate_bps,
821 bitrate_config.max_bitrate_bps); 822 bitrate_config.max_bitrate_bps);
822 } 823 }
823 824
824 void Call::SignalChannelNetworkState(MediaType media, NetworkState state) { 825 void Call::SignalChannelNetworkState(MediaType media, NetworkState state) {
825 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); 826 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
826 switch (media) { 827 switch (media) {
827 case MediaType::AUDIO: 828 case MediaType::AUDIO:
828 audio_network_state_ = state; 829 audio_network_state_ = state;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 if (kv->second != network_route) { 906 if (kv->second != network_route) {
906 kv->second = network_route; 907 kv->second = network_route;
907 LOG(LS_INFO) << "Network route changed on transport " << transport_name 908 LOG(LS_INFO) << "Network route changed on transport " << transport_name
908 << ": new local network id " << network_route.local_network_id 909 << ": new local network id " << network_route.local_network_id
909 << " new remote network id " << network_route.remote_network_id 910 << " new remote network id " << network_route.remote_network_id
910 << " Reset bitrates to min: " 911 << " Reset bitrates to min: "
911 << config_.bitrate_config.min_bitrate_bps 912 << config_.bitrate_config.min_bitrate_bps
912 << " bps, start: " << config_.bitrate_config.start_bitrate_bps 913 << " bps, start: " << config_.bitrate_config.start_bitrate_bps
913 << " bps, max: " << config_.bitrate_config.start_bitrate_bps 914 << " bps, max: " << config_.bitrate_config.start_bitrate_bps
914 << " bps."; 915 << " bps.";
916 RTC_DCHECK_GT(config_.bitrate_config.start_bitrate_bps, 0);
915 congestion_controller_->ResetBweAndBitrates( 917 congestion_controller_->ResetBweAndBitrates(
916 config_.bitrate_config.start_bitrate_bps, 918 config_.bitrate_config.start_bitrate_bps,
917 config_.bitrate_config.min_bitrate_bps, 919 config_.bitrate_config.min_bitrate_bps,
918 config_.bitrate_config.max_bitrate_bps); 920 config_.bitrate_config.max_bitrate_bps);
919 } 921 }
920 } 922 }
921 923
922 void Call::UpdateAggregateNetworkState() { 924 void Call::UpdateAggregateNetworkState() {
923 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); 925 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread());
924 926
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 1208
1207 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet) { 1209 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet) {
1208 RTPHeader header; 1210 RTPHeader header;
1209 packet.GetHeader(&header); 1211 packet.GetHeader(&header);
1210 congestion_controller_->OnReceivedPacket(packet.arrival_time_ms(), 1212 congestion_controller_->OnReceivedPacket(packet.arrival_time_ms(),
1211 packet.payload_size(), header); 1213 packet.payload_size(), header);
1212 } 1214 }
1213 1215
1214 } // namespace internal 1216 } // namespace internal
1215 } // namespace webrtc 1217 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/call/rampup_tests.h » ('j') | webrtc/call/rampup_tests.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698