Index: webrtc/modules/pacing/alr_detector.h |
diff --git a/webrtc/modules/pacing/alr_detector.h b/webrtc/modules/pacing/alr_detector.h |
index d8870ff04bb14d783e803c041041c9b4fe066506..087e444da1e886d1d642ee1e4aa25d22bd99e046 100644 |
--- a/webrtc/modules/pacing/alr_detector.h |
+++ b/webrtc/modules/pacing/alr_detector.h |
@@ -11,6 +11,7 @@ |
#ifndef WEBRTC_MODULES_PACING_ALR_DETECTOR_H_ |
#define WEBRTC_MODULES_PACING_ALR_DETECTOR_H_ |
+#include "webrtc/base/optional.h" |
#include "webrtc/base/rate_statistics.h" |
#include "webrtc/common_types.h" |
#include "webrtc/modules/pacing/paced_sender.h" |
@@ -25,6 +26,7 @@ namespace webrtc { |
// AlrDetector provides a signal that can be utilized to adjust |
// estimate bandwidth. |
// Note: This class is not thread-safe. |
+ |
class AlrDetector { |
public: |
AlrDetector(); |
@@ -39,9 +41,28 @@ class AlrDetector { |
// started or empty result if the sender is currently not application-limited. |
rtc::Optional<int64_t> GetApplicationLimitedRegionStartTime() const; |
+ 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; |
+ }; |
+ static rtc::Optional<AlrExperimentSettings> ParseAlrSettingsFromFieldTrial(); |
+ |
+ // Sent traffic percentage as a function of network capacity used to determine |
+ // application-limited region. ALR region start when bandwidth usage drops |
+ // 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 const char* kScreenshareProbingBweExperimentName; |
+ |
private: |
+ int alr_start_usage_percent_; |
+ int alr_end_usage_percent_; |
RateStatistics rate_; |
- int estimated_bitrate_bps_ = 0; |
+ int estimated_bitrate_bps_; |
// Non-empty in ALR state. |
rtc::Optional<int64_t> alr_started_time_ms_; |