| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 last_update_ms_(-1), | 156 last_update_ms_(-1), |
| 157 last_seen_packet_ms_(-1), | 157 last_seen_packet_ms_(-1), |
| 158 uma_recorded_(false), | 158 uma_recorded_(false), |
| 159 probe_bitrate_estimator_(event_log), | 159 probe_bitrate_estimator_(event_log), |
| 160 trendline_window_size_(kDefaultTrendlineWindowSize), | 160 trendline_window_size_(kDefaultTrendlineWindowSize), |
| 161 trendline_smoothing_coeff_(kDefaultTrendlineSmoothingCoeff), | 161 trendline_smoothing_coeff_(kDefaultTrendlineSmoothingCoeff), |
| 162 trendline_threshold_gain_(kDefaultTrendlineThresholdGain), | 162 trendline_threshold_gain_(kDefaultTrendlineThresholdGain), |
| 163 probing_interval_estimator_(&rate_control_), | 163 probing_interval_estimator_(&rate_control_), |
| 164 consecutive_delayed_feedbacks_(0), | 164 consecutive_delayed_feedbacks_(0), |
| 165 last_logged_bitrate_(0), | 165 last_logged_bitrate_(0), |
| 166 last_logged_state_(kBwNormal) { | 166 last_logged_state_(BandwidthUsage::kBwNormal) { |
| 167 LOG(LS_INFO) << "Using Trendline filter for delay change estimation."; | 167 LOG(LS_INFO) << "Using Trendline filter for delay change estimation."; |
| 168 | 168 |
| 169 network_thread_.DetachFromThread(); | 169 network_thread_.DetachFromThread(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector( | 172 DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector( |
| 173 const std::vector<PacketFeedback>& packet_feedback_vector) { | 173 const std::vector<PacketFeedback>& packet_feedback_vector) { |
| 174 RTC_DCHECK(network_thread_.CalledOnValidThread()); | 174 RTC_DCHECK(network_thread_.CalledOnValidThread()); |
| 175 RTC_DCHECK(!packet_feedback_vector.empty()); | 175 RTC_DCHECK(!packet_feedback_vector.empty()); |
| 176 | 176 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 270 |
| 271 int probing_bps = 0; | 271 int probing_bps = 0; |
| 272 if (packet_feedback.pacing_info.probe_cluster_id != | 272 if (packet_feedback.pacing_info.probe_cluster_id != |
| 273 PacedPacketInfo::kNotAProbe) { | 273 PacedPacketInfo::kNotAProbe) { |
| 274 probing_bps = | 274 probing_bps = |
| 275 probe_bitrate_estimator_.HandleProbeAndEstimateBitrate(packet_feedback); | 275 probe_bitrate_estimator_.HandleProbeAndEstimateBitrate(packet_feedback); |
| 276 } | 276 } |
| 277 rtc::Optional<uint32_t> acked_bitrate_bps = | 277 rtc::Optional<uint32_t> acked_bitrate_bps = |
| 278 receiver_incoming_bitrate_.bitrate_bps(); | 278 receiver_incoming_bitrate_.bitrate_bps(); |
| 279 // Currently overusing the bandwidth. | 279 // Currently overusing the bandwidth. |
| 280 if (detector_.State() == kBwOverusing) { | 280 if (detector_.State() == BandwidthUsage::kBwOverusing) { |
| 281 if (acked_bitrate_bps && | 281 if (acked_bitrate_bps && |
| 282 rate_control_.TimeToReduceFurther(now_ms, *acked_bitrate_bps)) { | 282 rate_control_.TimeToReduceFurther(now_ms, *acked_bitrate_bps)) { |
| 283 result.updated = | 283 result.updated = |
| 284 UpdateEstimate(packet_feedback.arrival_time_ms, now_ms, | 284 UpdateEstimate(packet_feedback.arrival_time_ms, now_ms, |
| 285 acked_bitrate_bps, &result.target_bitrate_bps); | 285 acked_bitrate_bps, &result.target_bitrate_bps); |
| 286 } | 286 } |
| 287 } else if (probing_bps > 0) { | 287 } else if (probing_bps > 0) { |
| 288 // No overuse, but probing measured a bitrate. | 288 // No overuse, but probing measured a bitrate. |
| 289 rate_control_.SetEstimate(probing_bps, packet_feedback.arrival_time_ms); | 289 rate_control_.SetEstimate(probing_bps, packet_feedback.arrival_time_ms); |
| 290 result.probe = true; | 290 result.probe = true; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { | 354 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { |
| 355 // Called from both the configuration thread and the network thread. Shouldn't | 355 // Called from both the configuration thread and the network thread. Shouldn't |
| 356 // be called from the network thread in the future. | 356 // be called from the network thread in the future. |
| 357 rate_control_.SetMinBitrate(min_bitrate_bps); | 357 rate_control_.SetMinBitrate(min_bitrate_bps); |
| 358 } | 358 } |
| 359 | 359 |
| 360 int64_t DelayBasedBwe::GetProbingIntervalMs() const { | 360 int64_t DelayBasedBwe::GetProbingIntervalMs() const { |
| 361 return probing_interval_estimator_.GetIntervalMs(); | 361 return probing_interval_estimator_.GetIntervalMs(); |
| 362 } | 362 } |
| 363 } // namespace webrtc | 363 } // namespace webrtc |
| OLD | NEW |