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

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

Issue 2653883002: Set the start bitrate to the delay-based BWE. (Closed)
Patch Set: Add test. Created 3 years, 11 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 min_bitrate_bps, 222 min_bitrate_bps,
223 max_bitrate_bps); 223 max_bitrate_bps);
224 224
225 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps, 225 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps,
226 max_bitrate_bps); 226 max_bitrate_bps);
227 max_bitrate_bps_ = max_bitrate_bps; 227 max_bitrate_bps_ = max_bitrate_bps;
228 228
229 if (remote_bitrate_estimator_) 229 if (remote_bitrate_estimator_)
230 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps); 230 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps);
231 min_bitrate_bps_ = min_bitrate_bps; 231 min_bitrate_bps_ = min_bitrate_bps;
232 transport_feedback_adapter_.SetStartBitrate(start_bitrate_bps);
232 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); 233 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_);
233 MaybeTriggerOnNetworkChanged(); 234 MaybeTriggerOnNetworkChanged();
234 } 235 }
235 236
236 void CongestionController::ResetBweAndBitrates(int bitrate_bps, 237 void CongestionController::ResetBweAndBitrates(int bitrate_bps,
237 int min_bitrate_bps, 238 int min_bitrate_bps,
238 int max_bitrate_bps) { 239 int max_bitrate_bps) {
239 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); 240 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps);
240 // TODO(honghaiz): Recreate this object once the bitrate controller is 241 // TODO(honghaiz): Recreate this object once the bitrate controller is
241 // no longer exposed outside CongestionController. 242 // no longer exposed outside CongestionController.
242 bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps, 243 bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps,
243 max_bitrate_bps); 244 max_bitrate_bps);
244 min_bitrate_bps_ = min_bitrate_bps; 245 min_bitrate_bps_ = min_bitrate_bps;
245 max_bitrate_bps_ = max_bitrate_bps; 246 max_bitrate_bps_ = max_bitrate_bps;
246 // TODO(honghaiz): Recreate this object once the remote bitrate estimator is 247 // TODO(honghaiz): Recreate this object once the remote bitrate estimator is
247 // no longer exposed outside CongestionController. 248 // no longer exposed outside CongestionController.
248 if (remote_bitrate_estimator_) 249 if (remote_bitrate_estimator_)
249 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps); 250 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps);
250 251
251 transport_feedback_adapter_.InitBwe(); 252 transport_feedback_adapter_.InitBwe();
253 transport_feedback_adapter_.SetStartBitrate(bitrate_bps);
252 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps); 254 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps);
253 // TODO(holmer): Trigger a new probe once mid-call probing is implemented. 255 // TODO(holmer): Trigger a new probe once mid-call probing is implemented.
254 MaybeTriggerOnNetworkChanged(); 256 MaybeTriggerOnNetworkChanged();
255 } 257 }
256 258
257 BitrateController* CongestionController::GetBitrateController() const { 259 BitrateController* CongestionController::GetBitrateController() const {
258 return bitrate_controller_.get(); 260 return bitrate_controller_.get();
259 } 261 }
260 262
261 RemoteBitrateEstimator* CongestionController::GetRemoteBitrateEstimator( 263 RemoteBitrateEstimator* CongestionController::GetRemoteBitrateEstimator(
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 bool CongestionController::IsSendQueueFull() const { 389 bool CongestionController::IsSendQueueFull() const {
388 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 390 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
389 } 391 }
390 392
391 bool CongestionController::IsNetworkDown() const { 393 bool CongestionController::IsNetworkDown() const {
392 rtc::CritScope cs(&critsect_); 394 rtc::CritScope cs(&critsect_);
393 return network_state_ == kNetworkDown; 395 return network_state_ == kNetworkDown;
394 } 396 }
395 397
396 } // namespace webrtc 398 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698