 Chromium Code Reviews
 Chromium Code Reviews Issue 2000063003:
  Update the BWE when the network route changes.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc@master
    
  
    Issue 2000063003:
  Update the BWE when the network route changes.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc@master| Index: webrtc/modules/congestion_controller/congestion_controller.cc | 
| diff --git a/webrtc/modules/congestion_controller/congestion_controller.cc b/webrtc/modules/congestion_controller/congestion_controller.cc | 
| index 5767448a5f7bf711a24ef214ea47d5f5cac18f20..ca3d4ccbbc0bdea45d58588e0db9bc73df8a369d 100644 | 
| --- a/webrtc/modules/congestion_controller/congestion_controller.cc | 
| +++ b/webrtc/modules/congestion_controller/congestion_controller.cc | 
| @@ -212,21 +212,25 @@ void CongestionController::Init() { | 
| min_bitrate_bps_); | 
| } | 
| - | 
| -void CongestionController::SetBweBitrates(int min_bitrate_bps, | 
| - int start_bitrate_bps, | 
| - int max_bitrate_bps) { | 
| +void CongestionController::FixBitrates(int* bitrate_bps, | 
| 
stefan-webrtc
2016/05/27 21:46:15
ClampBitrates
 
honghaiz3
2016/05/27 23:20:44
Done.
 | 
| + int* min_bitrate_bps, | 
| + int* max_bitrate_bps) { | 
| // TODO(holmer): We should make sure the default bitrates are set to 10 kbps, | 
| // and that we don't try to set the min bitrate to 0 from any applications. | 
| // The congestion controller should allow a min bitrate of 0. | 
| const int kMinBitrateBps = 10000; | 
| - if (min_bitrate_bps < kMinBitrateBps) | 
| - min_bitrate_bps = kMinBitrateBps; | 
| - if (max_bitrate_bps > 0) | 
| - max_bitrate_bps = std::max(min_bitrate_bps, max_bitrate_bps); | 
| - if (start_bitrate_bps > 0) | 
| - start_bitrate_bps = std::max(min_bitrate_bps, start_bitrate_bps); | 
| + if (*min_bitrate_bps < kMinBitrateBps) | 
| + *min_bitrate_bps = kMinBitrateBps; | 
| + if (*max_bitrate_bps > 0) | 
| + *max_bitrate_bps = std::max(*min_bitrate_bps, *max_bitrate_bps); | 
| + if (*bitrate_bps > 0) | 
| + *bitrate_bps = std::max(*min_bitrate_bps, *bitrate_bps); | 
| +} | 
| +void CongestionController::SetBweBitrates(int min_bitrate_bps, | 
| + int start_bitrate_bps, | 
| + int max_bitrate_bps) { | 
| + FixBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); | 
| bitrate_controller_->SetBitrates(start_bitrate_bps, | 
| min_bitrate_bps, | 
| max_bitrate_bps); | 
| @@ -239,6 +243,15 @@ void CongestionController::SetBweBitrates(int min_bitrate_bps, | 
| MaybeTriggerOnNetworkChanged(); | 
| } | 
| +void CongestionController::ResetBweBitrates(int bitrate_bps, | 
| 
stefan-webrtc
2016/05/27 21:46:15
Is this called only on the send-side, or both send
 
honghaiz3
2016/05/27 23:20:44
Are we using the send-side BWE? Do we still need t
 
stefan-webrtc
2016/05/30 06:47:03
Receive-side BWE may still be negotiated instead o
 
honghaiz3
2016/06/01 16:54:10
Acknowledged.
 | 
| + int min_bitrate_bps, | 
| + int max_bitrate_bps) { | 
| + FixBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); | 
| + bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps, | 
| 
stefan-webrtc
2016/05/27 21:46:15
Seems incorrect to me that we don't also reset tra
 
honghaiz3
2016/05/27 23:20:44
Done.
 | 
| + max_bitrate_bps); | 
| + MaybeTriggerOnNetworkChanged(); | 
| +} | 
| + | 
| BitrateController* CongestionController::GetBitrateController() const { | 
| return bitrate_controller_.get(); | 
| } |