Chromium Code Reviews| 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..c4398a3ea4f4f6dd11d534688364537653bd54a7 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 = kDefaultAlrStartBudgetLevePercent; |
| + int alr_stop_budget_level_percent = kDefaultAlrStopBudgetLevePercent; |
| }; |
| 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 kDefaultAlrStartBudgetLevePercent = 20; |
|
stefan-webrtc
2017/07/06 14:55:37
Level?
tschumi
2017/07/07 08:47:30
Yes :)
|
| + static constexpr int kDefaultAlrStopBudgetLevePercent = -20; |
| 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_; |
| + 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_; |
| }; |