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 164 matching lines...) Loading... |
175 | 175 |
176 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { | 176 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { |
177 { | 177 { |
178 rtc::CritScope cs(&critsect_); | 178 rtc::CritScope cs(&critsect_); |
179 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), | 179 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), |
180 bitrate); | 180 bitrate); |
181 } | 181 } |
182 MaybeTriggerOnNetworkChanged(); | 182 MaybeTriggerOnNetworkChanged(); |
183 } | 183 } |
184 | 184 |
| 185 void BitrateControllerImpl::UpdateProbeBitrate(uint32_t bitrate_bps) { |
| 186 { |
| 187 rtc::CritScope cs(&critsect_); |
| 188 bandwidth_estimation_.SetSendBitrate(bitrate_bps); |
| 189 } |
| 190 MaybeTriggerOnNetworkChanged(); |
| 191 } |
| 192 |
185 void BitrateControllerImpl::UpdateDelayBasedEstimate(uint32_t bitrate_bps) { | 193 void BitrateControllerImpl::UpdateDelayBasedEstimate(uint32_t bitrate_bps) { |
186 { | 194 { |
187 rtc::CritScope cs(&critsect_); | 195 rtc::CritScope cs(&critsect_); |
188 bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(), | 196 bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(), |
189 bitrate_bps); | 197 bitrate_bps); |
190 } | 198 } |
191 MaybeTriggerOnNetworkChanged(); | 199 MaybeTriggerOnNetworkChanged(); |
192 } | 200 } |
193 | 201 |
194 int64_t BitrateControllerImpl::TimeUntilNextProcess() { | 202 int64_t BitrateControllerImpl::TimeUntilNextProcess() { |
(...skipping 73 matching lines...) Loading... |
268 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 276 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
269 if (bitrate > 0) { | 277 if (bitrate > 0) { |
270 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 278 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
271 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 279 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
272 *bandwidth = bitrate; | 280 *bandwidth = bitrate; |
273 return true; | 281 return true; |
274 } | 282 } |
275 return false; | 283 return false; |
276 } | 284 } |
277 } // namespace webrtc | 285 } // namespace webrtc |
OLD | NEW |