| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 last_logged_bitrate_(0), | 165 last_logged_bitrate_(0), |
| 166 last_logged_state_(BandwidthUsage::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()); | |
| 176 | 175 |
| 177 std::vector<PacketFeedback> sorted_packet_feedback_vector; | 176 std::vector<PacketFeedback> sorted_packet_feedback_vector; |
| 178 SortPacketFeedbackVector(packet_feedback_vector, | 177 SortPacketFeedbackVector(packet_feedback_vector, |
| 179 &sorted_packet_feedback_vector); | 178 &sorted_packet_feedback_vector); |
| 179 // TOOD(holmer): An empty feedback vector here likely means that |
| 180 // all acks were too late and that the send time history had |
| 181 // timed out. We should reduce the rate when this occurs. |
| 182 if (sorted_packet_feedback_vector.empty()) { |
| 183 LOG(LS_WARNING) << "Very late feedback received."; |
| 184 return DelayBasedBwe::Result(); |
| 185 } |
| 180 | 186 |
| 181 if (!uma_recorded_) { | 187 if (!uma_recorded_) { |
| 182 RTC_HISTOGRAM_ENUMERATION(kBweTypeHistogram, | 188 RTC_HISTOGRAM_ENUMERATION(kBweTypeHistogram, |
| 183 BweNames::kSendSideTransportSeqNum, | 189 BweNames::kSendSideTransportSeqNum, |
| 184 BweNames::kBweNamesMax); | 190 BweNames::kBweNamesMax); |
| 185 uma_recorded_ = true; | 191 uma_recorded_ = true; |
| 186 } | 192 } |
| 187 Result aggregated_result; | 193 Result aggregated_result; |
| 188 bool delayed_feedback = true; | 194 bool delayed_feedback = true; |
| 189 for (const auto& packet_feedback : sorted_packet_feedback_vector) { | 195 for (const auto& packet_feedback : sorted_packet_feedback_vector) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { | 360 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { |
| 355 // Called from both the configuration thread and the network thread. Shouldn't | 361 // Called from both the configuration thread and the network thread. Shouldn't |
| 356 // be called from the network thread in the future. | 362 // be called from the network thread in the future. |
| 357 rate_control_.SetMinBitrate(min_bitrate_bps); | 363 rate_control_.SetMinBitrate(min_bitrate_bps); |
| 358 } | 364 } |
| 359 | 365 |
| 360 int64_t DelayBasedBwe::GetProbingIntervalMs() const { | 366 int64_t DelayBasedBwe::GetProbingIntervalMs() const { |
| 361 return probing_interval_estimator_.GetIntervalMs(); | 367 return probing_interval_estimator_.GetIntervalMs(); |
| 362 } | 368 } |
| 363 } // namespace webrtc | 369 } // namespace webrtc |
| OLD | NEW |