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

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

Issue 1922483002: De-flake VideoSendStreamTest.ReconfigureBitratesSetsEncoderBitratesCorrectly (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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) 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void BitrateControllerImpl::SetMinMaxBitrate(int min_bitrate_bps, 116 void BitrateControllerImpl::SetMinMaxBitrate(int min_bitrate_bps,
117 int max_bitrate_bps) { 117 int max_bitrate_bps) {
118 { 118 {
119 rtc::CritScope cs(&critsect_); 119 rtc::CritScope cs(&critsect_);
120 bandwidth_estimation_.SetMinMaxBitrate(min_bitrate_bps, max_bitrate_bps); 120 bandwidth_estimation_.SetMinMaxBitrate(min_bitrate_bps, max_bitrate_bps);
121 } 121 }
122 MaybeTriggerOnNetworkChanged(); 122 MaybeTriggerOnNetworkChanged();
123 } 123 }
124 124
125 void BitrateControllerImpl::SetMinMaxStartBitrate(int start_bitrate_bps,
126 int min_bitrate_bps,
127 int max_bitrate_bps) {
128 {
129 rtc::CritScope cs(&critsect_);
130 bandwidth_estimation_.SetMinMaxBitrate(min_bitrate_bps, max_bitrate_bps);
131 bandwidth_estimation_.SetSendBitrate(start_bitrate_bps);
stefan-webrtc 2016/04/26 11:10:43 Replace these with a single SetMinMaxSendBitrate.
philipel 2016/04/28 10:42:57 Done.
132 }
133 MaybeTriggerOnNetworkChanged();
134 }
135
125 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { 136 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) {
126 { 137 {
127 rtc::CritScope cs(&critsect_); 138 rtc::CritScope cs(&critsect_);
128 reserved_bitrate_bps_ = reserved_bitrate_bps; 139 reserved_bitrate_bps_ = reserved_bitrate_bps;
129 } 140 }
130 MaybeTriggerOnNetworkChanged(); 141 MaybeTriggerOnNetworkChanged();
131 } 142 }
132 143
133 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) { 144 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) {
134 rtc::CritScope cs(&critsect_); 145 rtc::CritScope cs(&critsect_);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); 237 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
227 if (bitrate > 0) { 238 if (bitrate > 0) {
228 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); 239 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_);
229 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); 240 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate());
230 *bandwidth = bitrate; 241 *bandwidth = bitrate;
231 return true; 242 return true;
232 } 243 }
233 return false; 244 return false;
234 } 245 }
235 } // namespace webrtc 246 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698