| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::SetBitrates(int start_bitrate_bps, |
| 126 int min_bitrate_bps, |
| 127 int max_bitrate_bps) { |
| 128 { |
| 129 rtc::CritScope cs(&critsect_); |
| 130 bandwidth_estimation_.SetBitrates(start_bitrate_bps, |
| 131 min_bitrate_bps, |
| 132 max_bitrate_bps); |
| 133 } |
| 134 MaybeTriggerOnNetworkChanged(); |
| 135 } |
| 136 |
| 125 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { | 137 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { |
| 126 { | 138 { |
| 127 rtc::CritScope cs(&critsect_); | 139 rtc::CritScope cs(&critsect_); |
| 128 reserved_bitrate_bps_ = reserved_bitrate_bps; | 140 reserved_bitrate_bps_ = reserved_bitrate_bps; |
| 129 } | 141 } |
| 130 MaybeTriggerOnNetworkChanged(); | 142 MaybeTriggerOnNetworkChanged(); |
| 131 } | 143 } |
| 132 | 144 |
| 133 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) { | 145 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) { |
| 134 rtc::CritScope cs(&critsect_); | 146 rtc::CritScope cs(&critsect_); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 238 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
| 227 if (bitrate > 0) { | 239 if (bitrate > 0) { |
| 228 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 240 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
| 229 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 241 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
| 230 *bandwidth = bitrate; | 242 *bandwidth = bitrate; |
| 231 return true; | 243 return true; |
| 232 } | 244 } |
| 233 return false; | 245 return false; |
| 234 } | 246 } |
| 235 } // namespace webrtc | 247 } // namespace webrtc |
| OLD | NEW |