OLD | NEW |
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 bitrate_controller_->SetBitrates(start_bitrate_bps, | 203 bitrate_controller_->SetBitrates(start_bitrate_bps, |
204 min_bitrate_bps, | 204 min_bitrate_bps, |
205 max_bitrate_bps); | 205 max_bitrate_bps); |
206 | 206 |
207 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps, | 207 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps, |
208 max_bitrate_bps); | 208 max_bitrate_bps); |
209 max_bitrate_bps_ = max_bitrate_bps; | 209 max_bitrate_bps_ = max_bitrate_bps; |
210 | 210 |
211 remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps); | 211 remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps); |
212 min_bitrate_bps_ = min_bitrate_bps; | 212 min_bitrate_bps_ = min_bitrate_bps; |
213 transport_feedback_adapter_.SetStartBitrate(start_bitrate_bps); | 213 if (start_bitrate_bps > 0) |
| 214 transport_feedback_adapter_.SetStartBitrate(start_bitrate_bps); |
214 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); | 215 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); |
215 MaybeTriggerOnNetworkChanged(); | 216 MaybeTriggerOnNetworkChanged(); |
216 } | 217 } |
217 | 218 |
218 void CongestionController::ResetBweAndBitrates(int bitrate_bps, | 219 void CongestionController::ResetBweAndBitrates(int bitrate_bps, |
219 int min_bitrate_bps, | 220 int min_bitrate_bps, |
220 int max_bitrate_bps) { | 221 int max_bitrate_bps) { |
221 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); | 222 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); |
222 // TODO(honghaiz): Recreate this object once the bitrate controller is | 223 // TODO(honghaiz): Recreate this object once the bitrate controller is |
223 // no longer exposed outside CongestionController. | 224 // no longer exposed outside CongestionController. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 bool CongestionController::IsSendQueueFull() const { | 370 bool CongestionController::IsSendQueueFull() const { |
370 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 371 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
371 } | 372 } |
372 | 373 |
373 bool CongestionController::IsNetworkDown() const { | 374 bool CongestionController::IsNetworkDown() const { |
374 rtc::CritScope cs(&critsect_); | 375 rtc::CritScope cs(&critsect_); |
375 return network_state_ == kNetworkDown; | 376 return network_state_ == kNetworkDown; |
376 } | 377 } |
377 | 378 |
378 } // namespace webrtc | 379 } // namespace webrtc |
OLD | NEW |