OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 auto delta_it = delta_vec.begin(); | 81 auto delta_it = delta_vec.begin(); |
82 std::vector<PacketInfo> packet_feedback_vector; | 82 std::vector<PacketInfo> packet_feedback_vector; |
83 packet_feedback_vector.reserve(delta_vec.size()); | 83 packet_feedback_vector.reserve(delta_vec.size()); |
84 | 84 |
85 { | 85 { |
86 rtc::CritScope cs(&lock_); | 86 rtc::CritScope cs(&lock_); |
87 size_t failed_lookups = 0; | 87 size_t failed_lookups = 0; |
88 int64_t offset_us = 0; | 88 int64_t offset_us = 0; |
89 for (auto symbol : feedback.GetStatusVector()) { | 89 for (auto symbol : feedback.GetStatusVector()) { |
90 if (symbol != rtcp::TransportFeedback::StatusSymbol::kNotReceived) { | 90 if (symbol != rtcp::TransportFeedback::StatusSymbol::kNotReceived) { |
91 DCHECK(delta_it != delta_vec.end()); | 91 RTC_DCHECK(delta_it != delta_vec.end()); |
92 offset_us += *(delta_it++); | 92 offset_us += *(delta_it++); |
93 int64_t timestamp_ms = current_offset_ms_ + (offset_us / 1000); | 93 int64_t timestamp_ms = current_offset_ms_ + (offset_us / 1000); |
94 PacketInfo info = {timestamp_ms, 0, sequence_number, 0, false}; | 94 PacketInfo info = {timestamp_ms, 0, sequence_number, 0, false}; |
95 if (send_time_history_.GetInfo(&info, true)) { | 95 if (send_time_history_.GetInfo(&info, true)) { |
96 packet_feedback_vector.push_back(info); | 96 packet_feedback_vector.push_back(info); |
97 } else { | 97 } else { |
98 ++failed_lookups; | 98 ++failed_lookups; |
99 } | 99 } |
100 } | 100 } |
101 ++sequence_number; | 101 ++sequence_number; |
102 } | 102 } |
103 DCHECK(delta_it == delta_vec.end()); | 103 RTC_DCHECK(delta_it == delta_vec.end()); |
104 if (failed_lookups > 0) { | 104 if (failed_lookups > 0) { |
105 LOG(LS_WARNING) << "Failed to lookup send time for " << failed_lookups | 105 LOG(LS_WARNING) << "Failed to lookup send time for " << failed_lookups |
106 << " packet" << (failed_lookups > 1 ? "s" : "") | 106 << " packet" << (failed_lookups > 1 ? "s" : "") |
107 << ". Send time history too small?"; | 107 << ". Send time history too small?"; |
108 } | 108 } |
109 } | 109 } |
110 DCHECK(bitrate_estimator_.get() != nullptr); | 110 RTC_DCHECK(bitrate_estimator_.get() != nullptr); |
111 bitrate_estimator_->IncomingPacketFeedbackVector(packet_feedback_vector); | 111 bitrate_estimator_->IncomingPacketFeedbackVector(packet_feedback_vector); |
112 } | 112 } |
113 | 113 |
114 void TransportFeedbackAdapter::OnReceiveBitrateChanged( | 114 void TransportFeedbackAdapter::OnReceiveBitrateChanged( |
115 const std::vector<unsigned int>& ssrcs, | 115 const std::vector<unsigned int>& ssrcs, |
116 unsigned int bitrate) { | 116 unsigned int bitrate) { |
117 rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(bitrate); | 117 rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(bitrate); |
118 } | 118 } |
119 | 119 |
120 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, | 120 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, |
121 int64_t max_rtt_ms) { | 121 int64_t max_rtt_ms) { |
122 DCHECK(bitrate_estimator_.get() != nullptr); | 122 RTC_DCHECK(bitrate_estimator_.get() != nullptr); |
123 bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); | 123 bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); |
124 } | 124 } |
125 | 125 |
126 } // namespace webrtc | 126 } // namespace webrtc |
OLD | NEW |