OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 std::string experiment_string = | 53 std::string experiment_string = |
54 webrtc::field_trial::FindFullName(kAdaptiveThresholdExperiment); | 54 webrtc::field_trial::FindFullName(kAdaptiveThresholdExperiment); |
55 const size_t kMinExperimentLength = kEnabledPrefixLength + 3; | 55 const size_t kMinExperimentLength = kEnabledPrefixLength + 3; |
56 if (experiment_string.length() < kMinExperimentLength || | 56 if (experiment_string.length() < kMinExperimentLength || |
57 experiment_string.substr(0, kEnabledPrefixLength) != kEnabledPrefix) | 57 experiment_string.substr(0, kEnabledPrefixLength) != kEnabledPrefix) |
58 return false; | 58 return false; |
59 return sscanf(experiment_string.substr(kEnabledPrefixLength + 1).c_str(), | 59 return sscanf(experiment_string.substr(kEnabledPrefixLength + 1).c_str(), |
60 "%lf,%lf", k_up, k_down) == 2; | 60 "%lf,%lf", k_up, k_down) == 2; |
61 } | 61 } |
62 | 62 |
63 OveruseDetector::OveruseDetector(const OverUseDetectorOptions& options) | 63 OveruseDetector::OveruseDetector() |
64 // Experiment is on by default, but can be disabled with finch by setting | 64 // Experiment is on by default, but can be disabled with finch by setting |
65 // the field trial string to "WebRTC-AdaptiveBweThreshold/Disabled/". | 65 // the field trial string to "WebRTC-AdaptiveBweThreshold/Disabled/". |
66 : in_experiment_(!AdaptiveThresholdExperimentIsDisabled()), | 66 : in_experiment_(!AdaptiveThresholdExperimentIsDisabled()), |
67 k_up_(0.0087), | 67 k_up_(0.0087), |
68 k_down_(0.039), | 68 k_down_(0.039), |
69 overusing_time_threshold_(100), | 69 overusing_time_threshold_(100), |
70 options_(options), | |
71 threshold_(12.5), | 70 threshold_(12.5), |
72 last_update_ms_(-1), | 71 last_update_ms_(-1), |
73 prev_offset_(0.0), | 72 prev_offset_(0.0), |
74 time_over_using_(-1), | 73 time_over_using_(-1), |
75 overuse_counter_(0), | 74 overuse_counter_(0), |
76 hypothesis_(kBwNormal) { | 75 hypothesis_(kBwNormal) { |
77 if (!AdaptiveThresholdExperimentIsDisabled()) | 76 if (!AdaptiveThresholdExperimentIsDisabled()) |
78 InitializeExperiment(); | 77 InitializeExperiment(); |
79 } | 78 } |
80 | 79 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 RTC_DCHECK(in_experiment_); | 159 RTC_DCHECK(in_experiment_); |
161 double k_up = 0.0; | 160 double k_up = 0.0; |
162 double k_down = 0.0; | 161 double k_down = 0.0; |
163 overusing_time_threshold_ = kOverUsingTimeThreshold; | 162 overusing_time_threshold_ = kOverUsingTimeThreshold; |
164 if (ReadExperimentConstants(&k_up, &k_down)) { | 163 if (ReadExperimentConstants(&k_up, &k_down)) { |
165 k_up_ = k_up; | 164 k_up_ = k_up; |
166 k_down_ = k_down; | 165 k_down_ = k_down; |
167 } | 166 } |
168 } | 167 } |
169 } // namespace webrtc | 168 } // namespace webrtc |
OLD | NEW |