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

Unified Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 2246403002: CongestionController::SetBweBitrates may now trigger probing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Don't set probing state to active in the case of no clusters. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/include/congestion_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 88bc9071364ea8f169f957cc9e9d38aa35f3f59e..68c306ce10077a93bbbf8e6c792b8dd20121970d 100644
--- a/webrtc/modules/congestion_controller/congestion_controller.cc
+++ b/webrtc/modules/congestion_controller/congestion_controller.cc
@@ -171,6 +171,7 @@ CongestionController::CongestionController(
remote_estimator_proxy_(clock_, packet_router_.get()),
transport_feedback_adapter_(bitrate_controller_.get(), clock_),
min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
+ max_bitrate_bps_(0),
last_reported_bitrate_bps_(0),
last_reported_fraction_loss_(0),
last_reported_rtt_(0),
@@ -200,6 +201,7 @@ CongestionController::CongestionController(
remote_estimator_proxy_(clock_, packet_router_.get()),
transport_feedback_adapter_(bitrate_controller_.get(), clock_),
min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps),
+ max_bitrate_bps_(0),
last_reported_bitrate_bps_(0),
last_reported_fraction_loss_(0),
last_reported_rtt_(0),
@@ -214,6 +216,8 @@ void CongestionController::Init() {
new DelayBasedBwe(&transport_feedback_adapter_, clock_));
transport_feedback_adapter_.GetBitrateEstimator()->SetMinBitrate(
min_bitrate_bps_);
+ pacer_->CreateProbeCluster(900000, 6);
+ pacer_->CreateProbeCluster(1800000, 5);
}
void CongestionController::SetBweBitrates(int min_bitrate_bps,
@@ -224,6 +228,21 @@ void CongestionController::SetBweBitrates(int min_bitrate_bps,
min_bitrate_bps,
max_bitrate_bps);
+ {
+ // Only do probing if:
+ // - we are mid-call, which we consider to be if
+ // |last_reported_bitrate_bps_| != 0, and
+ // - the current bitrate is lower than the new |max_bitrate_bps|, and
+ // - we actually want to increase the |max_bitrate_bps_|.
+ rtc::CritScope cs(&critsect_);
+ if (last_reported_bitrate_bps_ != 0 &&
+ last_reported_bitrate_bps_ < static_cast<uint32_t>(max_bitrate_bps) &&
+ max_bitrate_bps > max_bitrate_bps_) {
+ pacer_->CreateProbeCluster(max_bitrate_bps, 5);
+ }
+ }
+ max_bitrate_bps_ = max_bitrate_bps;
+
if (remote_bitrate_estimator_)
remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps);
min_bitrate_bps_ = min_bitrate_bps;
@@ -241,6 +260,7 @@ void CongestionController::ResetBweAndBitrates(int bitrate_bps,
bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps,
max_bitrate_bps);
min_bitrate_bps_ = min_bitrate_bps;
+ max_bitrate_bps_ = max_bitrate_bps;
// TODO(honghaiz): Recreate this object once the remote bitrate estimator is
// no longer exposed outside CongestionController.
if (remote_bitrate_estimator_)
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/include/congestion_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698