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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { | 166 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { |
167 { | 167 { |
168 rtc::CritScope cs(&critsect_); | 168 rtc::CritScope cs(&critsect_); |
169 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), | 169 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), |
170 bitrate); | 170 bitrate); |
171 } | 171 } |
172 MaybeTriggerOnNetworkChanged(); | 172 MaybeTriggerOnNetworkChanged(); |
173 } | 173 } |
174 | 174 |
| 175 void BitrateControllerImpl::UpdateProbeBitrate(uint32_t bitrate_bps) { |
| 176 { |
| 177 rtc::CritScope cs(&critsect_); |
| 178 bandwidth_estimation_.SetSendBitrate(bitrate_bps); |
| 179 } |
| 180 MaybeTriggerOnNetworkChanged(); |
| 181 } |
| 182 |
175 void BitrateControllerImpl::UpdateDelayBasedEstimate(uint32_t bitrate_bps) { | 183 void BitrateControllerImpl::UpdateDelayBasedEstimate(uint32_t bitrate_bps) { |
176 { | 184 { |
177 rtc::CritScope cs(&critsect_); | 185 rtc::CritScope cs(&critsect_); |
178 bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(), | 186 bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(), |
179 bitrate_bps); | 187 bitrate_bps); |
180 } | 188 } |
181 MaybeTriggerOnNetworkChanged(); | 189 MaybeTriggerOnNetworkChanged(); |
182 } | 190 } |
183 | 191 |
184 int64_t BitrateControllerImpl::TimeUntilNextProcess() { | 192 int64_t BitrateControllerImpl::TimeUntilNextProcess() { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 266 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
259 if (bitrate > 0) { | 267 if (bitrate > 0) { |
260 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 268 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
261 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 269 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
262 *bandwidth = bitrate; | 270 *bandwidth = bitrate; |
263 return true; | 271 return true; |
264 } | 272 } |
265 return false; | 273 return false; |
266 } | 274 } |
267 } // namespace webrtc | 275 } // namespace webrtc |
OLD | NEW |