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

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

Issue 2546613003: Fix exponential probing in ProbeController. (Closed)
Patch Set: Created 4 years 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/probe_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/probe_controller.cc
diff --git a/webrtc/modules/congestion_controller/probe_controller.cc b/webrtc/modules/congestion_controller/probe_controller.cc
index 757e2a1626f88bd816f0ad1d7f353234abe32227..10573c302941044fc236b95250207b9a0965055d 100644
--- a/webrtc/modules/congestion_controller/probe_controller.cc
+++ b/webrtc/modules/congestion_controller/probe_controller.cc
@@ -121,28 +121,17 @@ void ProbeController::SetEstimatedBitrate(int bitrate_bps) {
int64_t now_ms = clock_->TimeInMilliseconds();
if (state_ == State::kWaitingForProbingResult) {
- if ((now_ms - time_last_probing_initiated_ms_) >
- kMaxWaitingTimeForProbingResultMs) {
- LOG(LS_INFO) << "kWaitingForProbingResult: timeout";
- state_ = State::kProbingComplete;
- min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled;
- } else {
- // Continue probing if probing results indicate channel has greater
- // capacity.
- LOG(LS_INFO) << "Measured bitrate: " << bitrate_bps
- << " Minimum to probe further: "
- << min_bitrate_to_probe_further_bps_;
- if (min_bitrate_to_probe_further_bps_ != kExponentialProbingDisabled &&
- bitrate_bps > min_bitrate_to_probe_further_bps_) {
- // Double the probing bitrate and expect a minimum of 25% gain to
- // continue probing.
- InitiateProbing(now_ms, {2 * bitrate_bps},
- bitrate_bps * kRepeatedProbeMinPercentage / 100);
- } else {
- // Stop exponential probing.
- state_ = State::kProbingComplete;
- min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled;
- }
+ // Continue probing if probing results indicate channel has greater
+ // capacity.
+ LOG(LS_INFO) << "Measured bitrate: " << bitrate_bps
+ << " Minimum to probe further: "
+ << min_bitrate_to_probe_further_bps_;
+ if (min_bitrate_to_probe_further_bps_ != kExponentialProbingDisabled &&
+ bitrate_bps > min_bitrate_to_probe_further_bps_) {
+ // Double the probing bitrate and expect a minimum of 25% gain to
+ // continue probing.
+ InitiateProbing(now_ms, {2 * bitrate_bps},
+ bitrate_bps * kRepeatedProbeMinPercentage / 100);
}
}
@@ -182,6 +171,16 @@ void ProbeController::EnablePeriodicAlrProbing(bool enable) {
void ProbeController::Process() {
rtc::CritScope cs(&critsect_);
+ int64_t now_ms = clock_->TimeInMilliseconds();
+
+ if (state_ == State::kWaitingForProbingResult &&
+ (now_ms - time_last_probing_initiated_ms_) >
+ kMaxWaitingTimeForProbingResultMs) {
+ LOG(LS_INFO) << "kWaitingForProbingResult: timeout";
+ state_ = State::kProbingComplete;
+ min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled;
+ }
+
if (state_ != State::kProbingComplete || !enable_periodic_alr_probing_)
return;
@@ -189,7 +188,6 @@ void ProbeController::Process() {
rtc::Optional<int64_t> alr_start_time =
pacer_->GetApplicationLimitedRegionStartTime();
if (alr_start_time) {
- int64_t now_ms = clock_->TimeInMilliseconds();
int64_t next_probe_time_ms =
std::max(*alr_start_time, time_last_probing_initiated_ms_) +
kAlrPeriodicProbingIntervalMs;
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/probe_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698