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

Side by Side Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 1922483002: De-flake VideoSendStreamTest.ReconfigureBitratesSetsEncoderBitratesCorrectly (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback fixes Created 4 years, 7 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 int start_bitrate_bps, 169 int start_bitrate_bps,
170 int max_bitrate_bps) { 170 int max_bitrate_bps) {
171 // TODO(holmer): We should make sure the default bitrates are set to 10 kbps, 171 // TODO(holmer): We should make sure the default bitrates are set to 10 kbps,
172 // and that we don't try to set the min bitrate to 0 from any applications. 172 // and that we don't try to set the min bitrate to 0 from any applications.
173 // The congestion controller should allow a min bitrate of 0. 173 // The congestion controller should allow a min bitrate of 0.
174 const int kMinBitrateBps = 10000; 174 const int kMinBitrateBps = 10000;
175 if (min_bitrate_bps < kMinBitrateBps) 175 if (min_bitrate_bps < kMinBitrateBps)
176 min_bitrate_bps = kMinBitrateBps; 176 min_bitrate_bps = kMinBitrateBps;
177 if (max_bitrate_bps > 0) 177 if (max_bitrate_bps > 0)
178 max_bitrate_bps = std::max(min_bitrate_bps, max_bitrate_bps); 178 max_bitrate_bps = std::max(min_bitrate_bps, max_bitrate_bps);
179 if (start_bitrate_bps > 0) { 179 if (start_bitrate_bps > 0)
180 start_bitrate_bps = std::max(min_bitrate_bps, start_bitrate_bps); 180 start_bitrate_bps = std::max(min_bitrate_bps, start_bitrate_bps);
181 bitrate_controller_->SetStartBitrate(start_bitrate_bps); 181
182 } 182 bitrate_controller_->SetBitrates(start_bitrate_bps,
183 bitrate_controller_->SetMinMaxBitrate(min_bitrate_bps, max_bitrate_bps); 183 min_bitrate_bps,
184 max_bitrate_bps);
185
184 if (remote_bitrate_estimator_) 186 if (remote_bitrate_estimator_)
185 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps); 187 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps);
186 min_bitrate_bps_ = min_bitrate_bps; 188 min_bitrate_bps_ = min_bitrate_bps;
187 transport_feedback_adapter_.GetBitrateEstimator()->SetMinBitrate( 189 transport_feedback_adapter_.GetBitrateEstimator()->SetMinBitrate(
188 min_bitrate_bps_); 190 min_bitrate_bps_);
189 } 191 }
190 192
191 BitrateController* CongestionController::GetBitrateController() const { 193 BitrateController* CongestionController::GetBitrateController() const {
192 return bitrate_controller_.get(); 194 return bitrate_controller_.get();
193 } 195 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return std::min(bitrate_controller_->TimeUntilNextProcess(), 240 return std::min(bitrate_controller_->TimeUntilNextProcess(),
239 remote_bitrate_estimator_->TimeUntilNextProcess()); 241 remote_bitrate_estimator_->TimeUntilNextProcess());
240 } 242 }
241 243
242 void CongestionController::Process() { 244 void CongestionController::Process() {
243 bitrate_controller_->Process(); 245 bitrate_controller_->Process();
244 remote_bitrate_estimator_->Process(); 246 remote_bitrate_estimator_->Process();
245 } 247 }
246 248
247 } // namespace webrtc 249 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698