| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (last_seen_packet_ms_ == -1 || | 85 if (last_seen_packet_ms_ == -1 || |
| 86 now_ms - last_seen_packet_ms_ > kStreamTimeOutMs) { | 86 now_ms - last_seen_packet_ms_ > kStreamTimeOutMs) { |
| 87 inter_arrival_.reset(new InterArrival( | 87 inter_arrival_.reset(new InterArrival( |
| 88 (kTimestampGroupLengthMs << kInterArrivalShift) / 1000, | 88 (kTimestampGroupLengthMs << kInterArrivalShift) / 1000, |
| 89 kTimestampToMs, true)); | 89 kTimestampToMs, true)); |
| 90 estimator_.reset(new OveruseEstimator(OverUseDetectorOptions())); | 90 estimator_.reset(new OveruseEstimator(OverUseDetectorOptions())); |
| 91 } | 91 } |
| 92 last_seen_packet_ms_ = now_ms; | 92 last_seen_packet_ms_ = now_ms; |
| 93 | 93 |
| 94 if (info.probe_cluster_id != PacketInfo::kNotAProbe) { | 94 if (info.probe_cluster_id != PacketInfo::kNotAProbe) { |
| 95 ProbingResult probe_result = | 95 int bps = probe_bitrate_estimator_.HandleProbeAndEstimateBitrate(info); |
| 96 probe_bitrate_estimator_.PacketFeedback(info); | 96 if (bps > 0) { |
| 97 if (probe_result.valid()) { | 97 remote_rate_.SetEstimate(bps, info.arrival_time_ms); |
| 98 remote_rate_.SetEstimate(probe_result.bps, probe_result.timestamp); | |
| 99 update_estimate = true; | 98 update_estimate = true; |
| 100 } | 99 } |
| 101 } | 100 } |
| 102 | 101 |
| 103 uint32_t send_time_24bits = | 102 uint32_t send_time_24bits = |
| 104 static_cast<uint32_t>(((static_cast<uint64_t>(info.send_time_ms) | 103 static_cast<uint32_t>(((static_cast<uint64_t>(info.send_time_ms) |
| 105 << kAbsSendTimeFraction) + | 104 << kAbsSendTimeFraction) + |
| 106 500) / | 105 500) / |
| 107 1000) & | 106 1000) & |
| 108 0x00FFFFFF; | 107 0x00FFFFFF; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return true; | 187 return true; |
| 189 } | 188 } |
| 190 | 189 |
| 191 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { | 190 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { |
| 192 // Called from both the configuration thread and the network thread. Shouldn't | 191 // Called from both the configuration thread and the network thread. Shouldn't |
| 193 // be called from the network thread in the future. | 192 // be called from the network thread in the future. |
| 194 rtc::CritScope lock(&crit_); | 193 rtc::CritScope lock(&crit_); |
| 195 remote_rate_.SetMinBitrate(min_bitrate_bps); | 194 remote_rate_.SetMinBitrate(min_bitrate_bps); |
| 196 } | 195 } |
| 197 } // namespace webrtc | 196 } // namespace webrtc |
| OLD | NEW |