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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { | 124 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { |
125 { | 125 { |
126 rtc::CritScope cs(&critsect_); | 126 rtc::CritScope cs(&critsect_); |
127 reserved_bitrate_bps_ = reserved_bitrate_bps; | 127 reserved_bitrate_bps_ = reserved_bitrate_bps; |
128 } | 128 } |
129 MaybeTriggerOnNetworkChanged(); | 129 MaybeTriggerOnNetworkChanged(); |
130 } | 130 } |
131 | 131 |
| 132 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) { |
| 133 rtc::CritScope cs(&critsect_); |
| 134 bandwidth_estimation_.SetEventLog(event_log); |
| 135 } |
| 136 |
132 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { | 137 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { |
133 { | 138 { |
134 rtc::CritScope cs(&critsect_); | 139 rtc::CritScope cs(&critsect_); |
135 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), | 140 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), |
136 bitrate); | 141 bitrate); |
137 } | 142 } |
138 MaybeTriggerOnNetworkChanged(); | 143 MaybeTriggerOnNetworkChanged(); |
139 } | 144 } |
140 | 145 |
141 int64_t BitrateControllerImpl::TimeUntilNextProcess() { | 146 int64_t BitrateControllerImpl::TimeUntilNextProcess() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); | 217 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); |
213 if (bitrate > 0) { | 218 if (bitrate > 0) { |
214 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); | 219 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); |
215 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); | 220 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); |
216 *bandwidth = bitrate; | 221 *bandwidth = bitrate; |
217 return true; | 222 return true; |
218 } | 223 } |
219 return false; | 224 return false; |
220 } | 225 } |
221 } // namespace webrtc | 226 } // namespace webrtc |
OLD | NEW |