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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 BandwidthUsage OveruseDetector::Detect(double offset, | 86 BandwidthUsage OveruseDetector::Detect(double offset, |
87 double ts_delta, | 87 double ts_delta, |
88 int num_of_deltas, | 88 int num_of_deltas, |
89 int64_t now_ms) { | 89 int64_t now_ms) { |
90 if (num_of_deltas < 2) { | 90 if (num_of_deltas < 2) { |
91 return kBwNormal; | 91 return kBwNormal; |
92 } | 92 } |
93 const double prev_offset = prev_offset_; | 93 const double prev_offset = prev_offset_; |
94 prev_offset_ = offset; | 94 prev_offset_ = offset; |
95 const double T = std::min(num_of_deltas, 60) * offset; | 95 const double T = std::min(num_of_deltas, 60) * offset; |
96 BWE_TEST_LOGGING_PLOT(1, "offset", now_ms, T); | 96 BWE_TEST_LOGGING_PLOT(1, "offset[ms]", now_ms, offset); |
97 BWE_TEST_LOGGING_PLOT(1, "threshold", now_ms, threshold_); | 97 BWE_TEST_LOGGING_PLOT(1, "gamma[ms]", now_ms, threshold_/60); |
stefan-webrtc
2016/09/01 14:07:35
Make 60 a named constant and use the same constant
Gaetano Carlucci
2016/09/01 16:06:26
ok
| |
98 if (T > threshold_) { | 98 if (T > threshold_) { |
99 if (time_over_using_ == -1) { | 99 if (time_over_using_ == -1) { |
100 // Initialize the timer. Assume that we've been | 100 // Initialize the timer. Assume that we've been |
101 // over-using half of the time since the previous | 101 // over-using half of the time since the previous |
102 // sample. | 102 // sample. |
103 time_over_using_ = ts_delta / 2; | 103 time_over_using_ = ts_delta / 2; |
104 } else { | 104 } else { |
105 // Increment timer | 105 // Increment timer |
106 time_over_using_ += ts_delta; | 106 time_over_using_ += ts_delta; |
107 } | 107 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 RTC_DCHECK(in_experiment_); | 159 RTC_DCHECK(in_experiment_); |
160 double k_up = 0.0; | 160 double k_up = 0.0; |
161 double k_down = 0.0; | 161 double k_down = 0.0; |
162 overusing_time_threshold_ = kOverUsingTimeThreshold; | 162 overusing_time_threshold_ = kOverUsingTimeThreshold; |
163 if (ReadExperimentConstants(&k_up, &k_down)) { | 163 if (ReadExperimentConstants(&k_up, &k_down)) { |
164 k_up_ = k_up; | 164 k_up_ = k_up; |
165 k_down_ = k_down; | 165 k_down_ = k_down; |
166 } | 166 } |
167 } | 167 } |
168 } // namespace webrtc | 168 } // namespace webrtc |
OLD | NEW |