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

Unified Diff: webrtc/modules/pacing/alr_detector.cc

Issue 2504023002: Implement periodic bandwidth probing in application-limited region. (Closed)
Patch Set: address feedback Created 4 years, 1 month 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 | « webrtc/modules/pacing/alr_detector.h ('k') | webrtc/modules/pacing/alr_detector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/pacing/alr_detector.cc
diff --git a/webrtc/modules/pacing/alr_detector.cc b/webrtc/modules/pacing/alr_detector.cc
index 90afe18fef76a3368d1db725e758c5d31ffee8e9..1d771ac4fedf6fea492ce936c0fe508ebb672c56 100644
--- a/webrtc/modules/pacing/alr_detector.cc
+++ b/webrtc/modules/pacing/alr_detector.cc
@@ -44,10 +44,10 @@ void AlrDetector::OnBytesSent(size_t bytes_sent, int64_t now_ms) {
return;
int percentage = static_cast<int>(*rate) * 100 / estimated_bitrate_bps_;
- if (percentage < kAlrStartUsagePercent && !application_limited_) {
- application_limited_ = true;
- } else if (percentage > kAlrEndUsagePercent && application_limited_) {
- application_limited_ = false;
+ if (percentage < kAlrStartUsagePercent && !alr_started_time_ms_) {
+ alr_started_time_ms_ = now_ms;
+ } else if (percentage > kAlrEndUsagePercent && alr_started_time_ms_) {
+ alr_started_time_ms_ = 0;
}
}
@@ -56,8 +56,9 @@ void AlrDetector::SetEstimatedBitrate(int bitrate_bps) {
estimated_bitrate_bps_ = bitrate_bps;
}
-bool AlrDetector::InApplicationLimitedRegion() const {
- return application_limited_;
+rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime()
+ const {
+ return rtc::Optional<int64_t>(alr_started_time_ms_);
philipel 2016/11/22 10:55:10 We always return a value? That doesn't look right.
Sergey Ulanov 2016/11/22 23:21:00 Done.
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/pacing/alr_detector.h ('k') | webrtc/modules/pacing/alr_detector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698