| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 int max_bitrate_bps) { | 131 int max_bitrate_bps) { |
| 132 { | 132 { |
| 133 rtc::CritScope cs(&critsect_); | 133 rtc::CritScope cs(&critsect_); |
| 134 bandwidth_estimation_.SetBitrates(start_bitrate_bps, | 134 bandwidth_estimation_.SetBitrates(start_bitrate_bps, |
| 135 min_bitrate_bps, | 135 min_bitrate_bps, |
| 136 max_bitrate_bps); | 136 max_bitrate_bps); |
| 137 } | 137 } |
| 138 MaybeTriggerOnNetworkChanged(); | 138 MaybeTriggerOnNetworkChanged(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void BitrateControllerImpl::ResetBitrates(int bitrate_bps, | |
| 142 int min_bitrate_bps, | |
| 143 int max_bitrate_bps) { | |
| 144 { | |
| 145 rtc::CritScope cs(&critsect_); | |
| 146 bandwidth_estimation_ = SendSideBandwidthEstimation(); | |
| 147 bandwidth_estimation_.SetBitrates(bitrate_bps, min_bitrate_bps, | |
| 148 max_bitrate_bps); | |
| 149 } | |
| 150 MaybeTriggerOnNetworkChanged(); | |
| 151 } | |
| 152 | |
| 153 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { | 141 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { |
| 154 { | 142 { |
| 155 rtc::CritScope cs(&critsect_); | 143 rtc::CritScope cs(&critsect_); |
| 156 reserved_bitrate_bps_ = reserved_bitrate_bps; | 144 reserved_bitrate_bps_ = reserved_bitrate_bps; |
| 157 } | 145 } |
| 158 MaybeTriggerOnNetworkChanged(); | 146 MaybeTriggerOnNetworkChanged(); |
| 159 } | 147 } |
| 160 | 148 |
| 161 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) { | 149 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) { |
| 162 rtc::CritScope cs(&critsect_); | 150 rtc::CritScope cs(&critsect_); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 246 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
| 259 if (bitrate > 0) { | 247 if (bitrate > 0) { |
| 260 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 248 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
| 261 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 249 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
| 262 *bandwidth = bitrate; | 250 *bandwidth = bitrate; |
| 263 return true; | 251 return true; |
| 264 } | 252 } |
| 265 return false; | 253 return false; |
| 266 } | 254 } |
| 267 } // namespace webrtc | 255 } // namespace webrtc |
| OLD | NEW |