OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 25 matching lines...) Expand all Loading... |
36 rate_control_region_(kRcMaxUnknown), | 36 rate_control_region_(kRcMaxUnknown), |
37 time_last_bitrate_change_(-1), | 37 time_last_bitrate_change_(-1), |
38 current_input_(kBwNormal, rtc::Optional<uint32_t>(), 1.0), | 38 current_input_(kBwNormal, rtc::Optional<uint32_t>(), 1.0), |
39 updated_(false), | 39 updated_(false), |
40 time_first_incoming_estimate_(-1), | 40 time_first_incoming_estimate_(-1), |
41 bitrate_is_initialized_(false), | 41 bitrate_is_initialized_(false), |
42 beta_(0.85f), | 42 beta_(0.85f), |
43 rtt_(kDefaultRttMs), | 43 rtt_(kDefaultRttMs), |
44 in_experiment_(!AdaptiveThresholdExperimentIsDisabled()) {} | 44 in_experiment_(!AdaptiveThresholdExperimentIsDisabled()) {} |
45 | 45 |
| 46 AimdRateControl::~AimdRateControl() {} |
| 47 |
| 48 void AimdRateControl::SetStartBitrate(int start_bitrate_bps) { |
| 49 current_bitrate_bps_ = start_bitrate_bps; |
| 50 bitrate_is_initialized_ = true; |
| 51 } |
| 52 |
46 void AimdRateControl::SetMinBitrate(int min_bitrate_bps) { | 53 void AimdRateControl::SetMinBitrate(int min_bitrate_bps) { |
47 min_configured_bitrate_bps_ = min_bitrate_bps; | 54 min_configured_bitrate_bps_ = min_bitrate_bps; |
48 current_bitrate_bps_ = std::max<int>(min_bitrate_bps, current_bitrate_bps_); | 55 current_bitrate_bps_ = std::max<int>(min_bitrate_bps, current_bitrate_bps_); |
49 } | 56 } |
50 | 57 |
51 bool AimdRateControl::ValidEstimate() const { | 58 bool AimdRateControl::ValidEstimate() const { |
52 return bitrate_is_initialized_; | 59 return bitrate_is_initialized_; |
53 } | 60 } |
54 | 61 |
55 int64_t AimdRateControl::GetFeedbackInterval() const { | 62 int64_t AimdRateControl::GetFeedbackInterval() const { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 314 } |
308 | 315 |
309 void AimdRateControl::ChangeRegion(RateControlRegion region) { | 316 void AimdRateControl::ChangeRegion(RateControlRegion region) { |
310 rate_control_region_ = region; | 317 rate_control_region_ = region; |
311 } | 318 } |
312 | 319 |
313 void AimdRateControl::ChangeState(RateControlState new_state) { | 320 void AimdRateControl::ChangeState(RateControlState new_state) { |
314 rate_control_state_ = new_state; | 321 rate_control_state_ = new_state; |
315 } | 322 } |
316 } // namespace webrtc | 323 } // namespace webrtc |
OLD | NEW |