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

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

Issue 2637783003: Move congestion controller processing to the pacer thread. (Closed)
Patch Set: Fixed method call order for AlrDetector. 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 side-by-side diff with in-line comments
Download patch
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 94b3d8c6da98bbaee3a070e8e9f2421044a758b9..a6903077bea69f90cf9b78a0a51a383c8cd30b37 100644
--- a/webrtc/modules/congestion_controller/congestion_controller.cc
+++ b/webrtc/modules/congestion_controller/congestion_controller.cc
@@ -327,14 +327,27 @@ void CongestionController::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) {
}
int64_t CongestionController::TimeUntilNextProcess() {
- return std::min(bitrate_controller_->TimeUntilNextProcess(),
- remote_bitrate_estimator_->TimeUntilNextProcess());
+ // TODO(nisse): Any prettier way to get the minimum of 4 values?
+#if 0
+ return std::min(std::min(bitrate_controller_->TimeUntilNextProcess(),
+ remote_bitrate_estimator_->TimeUntilNextProcess()),
+ std::min(pacer_->TimeUntilNextProcess(),
+ remote_estimator_proxy_.TimeUntilNextProcess()));
+#else
+ // TODO(nisse): I think this is C++11. Ok?
stefan-webrtc 2017/01/16 15:42:46 I think this should be fine
nisse-webrtc 2017/01/16 16:14:03 Nice, doing it this way then.
+ return std::min({bitrate_controller_->TimeUntilNextProcess(),
+ remote_bitrate_estimator_->TimeUntilNextProcess(),
+ pacer_->TimeUntilNextProcess(),
+ remote_estimator_proxy_.TimeUntilNextProcess()});
+#endif
}
void CongestionController::Process() {
bitrate_controller_->Process();
remote_bitrate_estimator_->Process();
probe_controller_->Process();
+ pacer_->Process();
+ remote_estimator_proxy_.Process();
MaybeTriggerOnNetworkChanged();
}

Powered by Google App Engine
This is Rietveld 408576698