| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 MaybeTriggerOnNetworkChanged(); | 186 MaybeTriggerOnNetworkChanged(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void BitrateControllerImpl::OnDelayBasedBweResult( | 189 void BitrateControllerImpl::OnDelayBasedBweResult( |
| 190 const DelayBasedBwe::Result& result) { | 190 const DelayBasedBwe::Result& result) { |
| 191 if (!result.updated) | 191 if (!result.updated) |
| 192 return; | 192 return; |
| 193 { | 193 { |
| 194 rtc::CritScope cs(&critsect_); | 194 rtc::CritScope cs(&critsect_); |
| 195 bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(), |
| 196 result.target_bitrate_bps); |
| 195 if (result.probe) { | 197 if (result.probe) { |
| 196 bandwidth_estimation_.SetSendBitrate(result.target_bitrate_bps); | 198 bandwidth_estimation_.SetSendBitrate(result.target_bitrate_bps); |
| 197 } else { | |
| 198 bandwidth_estimation_.UpdateDelayBasedEstimate( | |
| 199 clock_->TimeInMilliseconds(), result.target_bitrate_bps); | |
| 200 } | 199 } |
| 201 } | 200 } |
| 202 MaybeTriggerOnNetworkChanged(); | 201 MaybeTriggerOnNetworkChanged(); |
| 203 } | 202 } |
| 204 | 203 |
| 205 int64_t BitrateControllerImpl::TimeUntilNextProcess() { | 204 int64_t BitrateControllerImpl::TimeUntilNextProcess() { |
| 206 const int64_t kBitrateControllerUpdateIntervalMs = 25; | 205 const int64_t kBitrateControllerUpdateIntervalMs = 25; |
| 207 rtc::CritScope cs(&critsect_); | 206 rtc::CritScope cs(&critsect_); |
| 208 int64_t time_since_update_ms = | 207 int64_t time_since_update_ms = |
| 209 clock_->TimeInMilliseconds() - last_bitrate_update_ms_; | 208 clock_->TimeInMilliseconds() - last_bitrate_update_ms_; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 286 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
| 288 if (bitrate > 0) { | 287 if (bitrate > 0) { |
| 289 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 288 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
| 290 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 289 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
| 291 *bandwidth = bitrate; | 290 *bandwidth = bitrate; |
| 292 return true; | 291 return true; |
| 293 } | 292 } |
| 294 return false; | 293 return false; |
| 295 } | 294 } |
| 296 } // namespace webrtc | 295 } // namespace webrtc |
| OLD | NEW |