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

Side by Side Diff: webrtc/modules/bitrate_controller/bitrate_controller_impl.cc

Issue 1320763003: Rate limit the low bandwidth / min bitrate warning to once every 10 seconds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 { 125 {
126 rtc::CritScope cs(&critsect_); 126 rtc::CritScope cs(&critsect_);
127 reserved_bitrate_bps_ = reserved_bitrate_bps; 127 reserved_bitrate_bps_ = reserved_bitrate_bps;
128 } 128 }
129 MaybeTriggerOnNetworkChanged(); 129 MaybeTriggerOnNetworkChanged();
130 } 130 }
131 131
132 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { 132 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) {
133 { 133 {
134 rtc::CritScope cs(&critsect_); 134 rtc::CritScope cs(&critsect_);
135 bandwidth_estimation_.UpdateReceiverEstimate(bitrate); 135 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(),
136 bitrate);
136 } 137 }
137 MaybeTriggerOnNetworkChanged(); 138 MaybeTriggerOnNetworkChanged();
138 } 139 }
139 140
140 int64_t BitrateControllerImpl::TimeUntilNextProcess() { 141 int64_t BitrateControllerImpl::TimeUntilNextProcess() {
141 const int64_t kBitrateControllerUpdateIntervalMs = 25; 142 const int64_t kBitrateControllerUpdateIntervalMs = 25;
142 rtc::CritScope cs(&critsect_); 143 rtc::CritScope cs(&critsect_);
143 int64_t time_since_update_ms = 144 int64_t time_since_update_ms =
144 clock_->TimeInMilliseconds() - last_bitrate_update_ms_; 145 clock_->TimeInMilliseconds() - last_bitrate_update_ms_;
145 return std::max<int64_t>( 146 return std::max<int64_t>(
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); 212 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
212 if (bitrate > 0) { 213 if (bitrate > 0) {
213 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); 214 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_);
214 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); 215 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate());
215 *bandwidth = bitrate; 216 *bandwidth = bitrate;
216 return true; 217 return true;
217 } 218 }
218 return false; 219 return false;
219 } 220 }
220 } // namespace webrtc 221 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698