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

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

Issue 2965233002: Let alr dectector use a budged to detect underuse. (Closed)
Patch Set: Response to comments Created 3 years, 5 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/pacing/alr_detector.h
diff --git a/webrtc/modules/pacing/alr_detector.h b/webrtc/modules/pacing/alr_detector.h
index 087e444da1e886d1d642ee1e4aa25d22bd99e046..197090cc16efcaac7c8ed8236cb3f817847300bc 100644
--- a/webrtc/modules/pacing/alr_detector.h
+++ b/webrtc/modules/pacing/alr_detector.h
@@ -14,6 +14,7 @@
#include "webrtc/base/optional.h"
#include "webrtc/base/rate_statistics.h"
#include "webrtc/common_types.h"
+#include "webrtc/modules/pacing/interval_budget.h"
#include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/typedefs.h"
@@ -32,7 +33,7 @@ class AlrDetector {
AlrDetector();
~AlrDetector();
- void OnBytesSent(size_t bytes_sent, int64_t now_ms);
+ void OnBytesSent(size_t bytes_sent, int64_t delta_time_ms);
// Set current estimated bandwidth.
void SetEstimatedBitrate(int bitrate_bps);
@@ -44,8 +45,9 @@ class AlrDetector {
struct AlrExperimentSettings {
float pacing_factor = PacedSender::kDefaultPaceMultiplier;
int64_t max_paced_queue_time = PacedSender::kMaxQueueLengthMs;
- int alr_start_usage_percent = kDefaultAlrStartUsagePercent;
- int alr_end_usage_percent = kDefaultAlrEndUsagePercent;
+ int alr_bandwidth_usage_percent = kDefaultAlrBandwidthUsagePercent;
+ int alr_start_budget_level_percent = kDefaultAlrStartBudgetLevelPercent;
+ int alr_stop_budget_level_percent = kDefaultAlrStopBudgetLevelPercent;
};
static rtc::Optional<AlrExperimentSettings> ParseAlrSettingsFromFieldTrial();
@@ -54,17 +56,20 @@ class AlrDetector {
// below kAlrStartUsagePercent and ends when it raises above
// kAlrEndUsagePercent. NOTE: This is intentionally conservative at the moment
// until BW adjustments of application limited region is fine tuned.
- static constexpr int kDefaultAlrStartUsagePercent = 60;
- static constexpr int kDefaultAlrEndUsagePercent = 70;
+ static constexpr int kDefaultAlrBandwidthUsagePercent = 65;
+ static constexpr int kDefaultAlrStartBudgetLevelPercent = 20;
+ static constexpr int kDefaultAlrStopBudgetLevelPercent = -20;
holmer 2017/07/07 09:21:22 -20% budget sounds to me like we're sending 20% to
terelius 2017/07/07 09:24:51 How does the budget level relate to BW usage. Is t
tschumi 2017/07/07 09:36:15 The budged can reach from -500ms overuse to +500ms
tschumi 2017/07/07 09:36:15 Is there any hysteresis => yes. will any bandwidth
terelius 2017/07/07 10:00:53 So that means that there is no hysteresis based on
static const char* kScreenshareProbingBweExperimentName;
+ void UpdateBudgetWithElapsedTime(int64_t delta_time_ms);
+ void UpdateBudgetWithBytesSent(size_t bytes_sent);
+
private:
- int alr_start_usage_percent_;
- int alr_end_usage_percent_;
- RateStatistics rate_;
- int estimated_bitrate_bps_;
+ int bandwidth_usage_percent_;
holmer 2017/07/07 09:21:22 It's not entirely clear to me what bandwidth_usage
tschumi 2017/07/07 09:36:15 It represents: alr_budget = bandwidth_usage_perce
+ int alr_start_budget_level_percent_;
+ int alr_stop_budget_level_percent_;
- // Non-empty in ALR state.
+ IntervalBudget alr_budget_;
rtc::Optional<int64_t> alr_started_time_ms_;
};

Powered by Google App Engine
This is Rietveld 408576698