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

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

Issue 2714503002: Perform probing on network route change. (Closed)
Patch Set: SendTimeHistoryTest.Clear fix. Created 3 years, 9 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
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 e8b3a2a1cb13b58831075ff7c0e0435eeee35f56..654f8b98f42d46d9830ee3f85044d8efed49bc89 100644
--- a/webrtc/modules/congestion_controller/probe_controller.cc
+++ b/webrtc/modules/congestion_controller/probe_controller.cc
@@ -48,18 +48,9 @@ constexpr int kRepeatedProbeMinPercentage = 70;
} // namespace
ProbeController::ProbeController(PacedSender* pacer, Clock* clock)
- : pacer_(pacer),
- clock_(clock),
- network_state_(kNetworkUp),
- state_(State::kInit),
- min_bitrate_to_probe_further_bps_(kExponentialProbingDisabled),
- time_last_probing_initiated_ms_(0),
- estimated_bitrate_bps_(0),
- start_bitrate_bps_(0),
- max_bitrate_bps_(0),
- last_alr_probing_time_(clock_->TimeInMilliseconds()),
- enable_periodic_alr_probing_(false),
- mid_call_probing_waiting_for_result_(false) {}
+ : pacer_(pacer), clock_(clock), enable_periodic_alr_probing_(false) {
+ Reset();
+}
void ProbeController::SetBitrates(int64_t min_bitrate_bps,
int64_t start_bitrate_bps,
@@ -186,6 +177,19 @@ void ProbeController::EnablePeriodicAlrProbing(bool enable) {
enable_periodic_alr_probing_ = enable;
}
+void ProbeController::Reset() {
+ rtc::CritScope cs(&critsect_);
+ network_state_ = kNetworkUp;
+ state_ = State::kInit;
+ min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled;
+ time_last_probing_initiated_ms_ = 0;
+ estimated_bitrate_bps_ = 0;
+ start_bitrate_bps_ = 0;
+ max_bitrate_bps_ = 0;
+ last_alr_probing_time_ = clock_->TimeInMilliseconds();
+ mid_call_probing_waiting_for_result_ = false;
+}
+
void ProbeController::Process() {
rtc::CritScope cs(&critsect_);

Powered by Google App Engine
This is Rietveld 408576698