OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/pacing/alr_detector.h" | 11 #include "webrtc/modules/pacing/alr_detector.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 #include "webrtc/base/logging.h" | 14 #include "webrtc/base/logging.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Time period over which outgoing traffic is measured. | 18 // Time period over which outgoing traffic is measured. |
19 constexpr int kMeasurementPeriodMs = 500; | 19 constexpr int kMeasurementPeriodMs = 500; |
20 | 20 |
21 // Sent traffic percentage as a function of network capacity used to determine | 21 // Sent traffic percentage as a function of network capacity used to determine |
22 // application-limited region. ALR region start when bandwidth usage drops below | 22 // application-limited region. ALR region start when bandwidth usage drops below |
23 // kAlrStartUsagePercent and ends when it raises above kAlrEndUsagePercent. | 23 // kAlrStartUsagePercent and ends when it raises above kAlrEndUsagePercent. |
24 // NOTE: This is intentionally conservative at the moment until BW adjustments | 24 // NOTE: This is intentionally conservative at the moment until BW adjustments |
25 // of application limited region is fine tuned. | 25 // of application limited region is fine tuned. |
26 constexpr int kAlrStartUsagePercent = 30; | 26 constexpr int kAlrStartUsagePercent = 60; |
27 constexpr int kAlrEndUsagePercent = 50; | 27 constexpr int kAlrEndUsagePercent = 70; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
32 | 32 |
33 AlrDetector::AlrDetector() | 33 AlrDetector::AlrDetector() |
34 : rate_(kMeasurementPeriodMs, RateStatistics::kBpsScale) {} | 34 : rate_(kMeasurementPeriodMs, RateStatistics::kBpsScale) {} |
35 | 35 |
36 AlrDetector::~AlrDetector() {} | 36 AlrDetector::~AlrDetector() {} |
37 | 37 |
(...skipping 17 matching lines...) Expand all Loading... |
55 RTC_DCHECK(bitrate_bps); | 55 RTC_DCHECK(bitrate_bps); |
56 estimated_bitrate_bps_ = bitrate_bps; | 56 estimated_bitrate_bps_ = bitrate_bps; |
57 } | 57 } |
58 | 58 |
59 rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime() | 59 rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime() |
60 const { | 60 const { |
61 return alr_started_time_ms_; | 61 return alr_started_time_ms_; |
62 } | 62 } |
63 | 63 |
64 } // namespace webrtc | 64 } // namespace webrtc |
OLD | NEW |