OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 detector_.Detect(estimator_->offset(), ts_delta_ms, | 308 detector_.Detect(estimator_->offset(), ts_delta_ms, |
309 estimator_->num_of_deltas(), arrival_time_ms); | 309 estimator_->num_of_deltas(), arrival_time_ms); |
310 } | 310 } |
311 | 311 |
312 if (!update_estimate) { | 312 if (!update_estimate) { |
313 // Check if it's time for a periodic update or if we should update because | 313 // Check if it's time for a periodic update or if we should update because |
314 // of an over-use. | 314 // of an over-use. |
315 if (last_update_ms_ == -1 || | 315 if (last_update_ms_ == -1 || |
316 now_ms - last_update_ms_ > remote_rate_.GetFeedbackInterval()) { | 316 now_ms - last_update_ms_ > remote_rate_.GetFeedbackInterval()) { |
317 update_estimate = true; | 317 update_estimate = true; |
318 } else if (detector_.State() == kBwOverusing) { | 318 } else if (detector_.State() == BandwidthUsage::kBwOverusing) { |
319 rtc::Optional<uint32_t> incoming_rate = | 319 rtc::Optional<uint32_t> incoming_rate = |
320 incoming_bitrate_.Rate(arrival_time_ms); | 320 incoming_bitrate_.Rate(arrival_time_ms); |
321 if (incoming_rate && | 321 if (incoming_rate && |
322 remote_rate_.TimeToReduceFurther(now_ms, *incoming_rate)) { | 322 remote_rate_.TimeToReduceFurther(now_ms, *incoming_rate)) { |
323 update_estimate = true; | 323 update_estimate = true; |
324 } | 324 } |
325 } | 325 } |
326 } | 326 } |
327 | 327 |
328 if (update_estimate) { | 328 if (update_estimate) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 return true; | 402 return true; |
403 } | 403 } |
404 | 404 |
405 void RemoteBitrateEstimatorAbsSendTime::SetMinBitrate(int min_bitrate_bps) { | 405 void RemoteBitrateEstimatorAbsSendTime::SetMinBitrate(int min_bitrate_bps) { |
406 // Called from both the configuration thread and the network thread. Shouldn't | 406 // Called from both the configuration thread and the network thread. Shouldn't |
407 // be called from the network thread in the future. | 407 // be called from the network thread in the future. |
408 rtc::CritScope lock(&crit_); | 408 rtc::CritScope lock(&crit_); |
409 remote_rate_.SetMinBitrate(min_bitrate_bps); | 409 remote_rate_.SetMinBitrate(min_bitrate_bps); |
410 } | 410 } |
411 } // namespace webrtc | 411 } // namespace webrtc |
OLD | NEW |