| 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 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); | 214 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); |
| 214 MaybeTriggerOnNetworkChanged(); | 215 MaybeTriggerOnNetworkChanged(); |
| 215 } | 216 } |
| 216 | 217 |
| 217 void CongestionController::ResetBweAndBitrates(int bitrate_bps, | 218 void CongestionController::ResetBweAndBitrates(int bitrate_bps, |
| 218 int min_bitrate_bps, | 219 int min_bitrate_bps, |
| 219 int max_bitrate_bps) { | 220 int max_bitrate_bps) { |
| 220 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); | 221 ClampBitrates(&bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); |
| 221 // TODO(honghaiz): Recreate this object once the bitrate controller is | 222 // TODO(honghaiz): Recreate this object once the bitrate controller is |
| 222 // no longer exposed outside CongestionController. | 223 // no longer exposed outside CongestionController. |
| 223 bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps, | 224 bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps, |
| 224 max_bitrate_bps); | 225 max_bitrate_bps); |
| 225 min_bitrate_bps_ = min_bitrate_bps; | 226 min_bitrate_bps_ = min_bitrate_bps; |
| 226 max_bitrate_bps_ = max_bitrate_bps; | 227 max_bitrate_bps_ = max_bitrate_bps; |
| 227 // TODO(honghaiz): Recreate this object once the remote bitrate estimator is | 228 // TODO(honghaiz): Recreate this object once the remote bitrate estimator is |
| 228 // no longer exposed outside CongestionController. | 229 // no longer exposed outside CongestionController. |
| 229 remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps); | 230 remote_bitrate_estimator_.SetMinBitrate(min_bitrate_bps); |
| 230 | 231 |
| 231 transport_feedback_adapter_.InitBwe(); | 232 transport_feedback_adapter_.InitBwe(); |
| 233 transport_feedback_adapter_.SetStartBitrate(bitrate_bps); |
| 232 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps); | 234 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps); |
| 233 // TODO(holmer): Trigger a new probe once mid-call probing is implemented. | 235 // TODO(holmer): Trigger a new probe once mid-call probing is implemented. |
| 234 MaybeTriggerOnNetworkChanged(); | 236 MaybeTriggerOnNetworkChanged(); |
| 235 } | 237 } |
| 236 | 238 |
| 237 BitrateController* CongestionController::GetBitrateController() const { | 239 BitrateController* CongestionController::GetBitrateController() const { |
| 238 return bitrate_controller_.get(); | 240 return bitrate_controller_.get(); |
| 239 } | 241 } |
| 240 | 242 |
| 241 RemoteBitrateEstimator* CongestionController::GetRemoteBitrateEstimator( | 243 RemoteBitrateEstimator* CongestionController::GetRemoteBitrateEstimator( |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 bool CongestionController::IsSendQueueFull() const { | 369 bool CongestionController::IsSendQueueFull() const { |
| 368 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 370 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
| 369 } | 371 } |
| 370 | 372 |
| 371 bool CongestionController::IsNetworkDown() const { | 373 bool CongestionController::IsNetworkDown() const { |
| 372 rtc::CritScope cs(&critsect_); | 374 rtc::CritScope cs(&critsect_); |
| 373 return network_state_ == kNetworkDown; | 375 return network_state_ == kNetworkDown; |
| 374 } | 376 } |
| 375 | 377 |
| 376 } // namespace webrtc | 378 } // namespace webrtc |
| OLD | NEW |