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 25 matching lines...) Expand all Loading... |
36 // The maximum time interval between first and the last probe on a cluster | 36 // The maximum time interval between first and the last probe on a cluster |
37 // on the sender side as well as the receive side. | 37 // on the sender side as well as the receive side. |
38 constexpr int kMaxProbeIntervalMs = 1000; | 38 constexpr int kMaxProbeIntervalMs = 1000; |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 namespace webrtc { | 41 namespace webrtc { |
42 | 42 |
43 ProbeBitrateEstimator::ProbeBitrateEstimator(RtcEventLog* event_log) | 43 ProbeBitrateEstimator::ProbeBitrateEstimator(RtcEventLog* event_log) |
44 : event_log_(event_log) {} | 44 : event_log_(event_log) {} |
45 | 45 |
| 46 ProbeBitrateEstimator::~ProbeBitrateEstimator() = default; |
| 47 |
46 int ProbeBitrateEstimator::HandleProbeAndEstimateBitrate( | 48 int ProbeBitrateEstimator::HandleProbeAndEstimateBitrate( |
47 const PacketFeedback& packet_feedback) { | 49 const PacketFeedback& packet_feedback) { |
48 int cluster_id = packet_feedback.pacing_info.probe_cluster_id; | 50 int cluster_id = packet_feedback.pacing_info.probe_cluster_id; |
49 RTC_DCHECK_NE(cluster_id, PacedPacketInfo::kNotAProbe); | 51 RTC_DCHECK_NE(cluster_id, PacedPacketInfo::kNotAProbe); |
50 | 52 |
51 EraseOldClusters(packet_feedback.arrival_time_ms - kMaxClusterHistoryMs); | 53 EraseOldClusters(packet_feedback.arrival_time_ms - kMaxClusterHistoryMs); |
52 | 54 |
53 int payload_size_bits = packet_feedback.payload_size * 8; | 55 int payload_size_bits = packet_feedback.payload_size * 8; |
54 AggregatedCluster* cluster = &clusters_[cluster_id]; | 56 AggregatedCluster* cluster = &clusters_[cluster_id]; |
55 | 57 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void ProbeBitrateEstimator::EraseOldClusters(int64_t timestamp_ms) { | 153 void ProbeBitrateEstimator::EraseOldClusters(int64_t timestamp_ms) { |
152 for (auto it = clusters_.begin(); it != clusters_.end();) { | 154 for (auto it = clusters_.begin(); it != clusters_.end();) { |
153 if (it->second.last_receive_ms < timestamp_ms) { | 155 if (it->second.last_receive_ms < timestamp_ms) { |
154 it = clusters_.erase(it); | 156 it = clusters_.erase(it); |
155 } else { | 157 } else { |
156 ++it; | 158 ++it; |
157 } | 159 } |
158 } | 160 } |
159 } | 161 } |
160 } // namespace webrtc | 162 } // namespace webrtc |
OLD | NEW |