Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc

Issue 2800633004: Resolve dependency between rtc_event_log_api and remote_bitrate_estimator (Closed)
Patch Set: Rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698