| 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 21 matching lines...) Expand all Loading... |
| 32 inline bool operator()(const PacketInfo& lhs, const PacketInfo& rhs) { | 32 inline bool operator()(const PacketInfo& lhs, const PacketInfo& rhs) { |
| 33 if (lhs.arrival_time_ms != rhs.arrival_time_ms) | 33 if (lhs.arrival_time_ms != rhs.arrival_time_ms) |
| 34 return lhs.arrival_time_ms < rhs.arrival_time_ms; | 34 return lhs.arrival_time_ms < rhs.arrival_time_ms; |
| 35 if (lhs.send_time_ms != rhs.send_time_ms) | 35 if (lhs.send_time_ms != rhs.send_time_ms) |
| 36 return lhs.send_time_ms < rhs.send_time_ms; | 36 return lhs.send_time_ms < rhs.send_time_ms; |
| 37 return lhs.sequence_number < rhs.sequence_number; | 37 return lhs.sequence_number < rhs.sequence_number; |
| 38 } | 38 } |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 TransportFeedbackAdapter::TransportFeedbackAdapter( | 41 TransportFeedbackAdapter::TransportFeedbackAdapter( |
| 42 BitrateController* bitrate_controller, | |
| 43 Clock* clock) | 42 Clock* clock) |
| 44 : send_time_history_(clock, kSendTimeHistoryWindowMs), | 43 : send_time_history_(clock, kSendTimeHistoryWindowMs), |
| 45 bitrate_controller_(bitrate_controller), | |
| 46 clock_(clock), | 44 clock_(clock), |
| 47 current_offset_ms_(kNoTimestamp), | 45 current_offset_ms_(kNoTimestamp), |
| 48 last_timestamp_us_(kNoTimestamp) {} | 46 last_timestamp_us_(kNoTimestamp) {} |
| 49 | 47 |
| 50 TransportFeedbackAdapter::~TransportFeedbackAdapter() { | 48 TransportFeedbackAdapter::~TransportFeedbackAdapter() { |
| 51 } | 49 } |
| 52 | 50 |
| 53 void TransportFeedbackAdapter::SetBitrateEstimator( | 51 void TransportFeedbackAdapter::SetBitrateEstimator( |
| 54 RemoteBitrateEstimator* rbe) { | 52 RemoteBitrateEstimator* rbe) { |
| 55 if (bitrate_estimator_.get() != rbe) { | 53 if (bitrate_estimator_.get() != rbe) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 127 } |
| 130 | 128 |
| 131 void TransportFeedbackAdapter::OnTransportFeedback( | 129 void TransportFeedbackAdapter::OnTransportFeedback( |
| 132 const rtcp::TransportFeedback& feedback) { | 130 const rtcp::TransportFeedback& feedback) { |
| 133 const std::vector<PacketInfo> packet_feedback_vector = | 131 const std::vector<PacketInfo> packet_feedback_vector = |
| 134 GetPacketFeedbackVector(feedback); | 132 GetPacketFeedbackVector(feedback); |
| 135 RTC_DCHECK(bitrate_estimator_.get() != nullptr); | 133 RTC_DCHECK(bitrate_estimator_.get() != nullptr); |
| 136 bitrate_estimator_->IncomingPacketFeedbackVector(packet_feedback_vector); | 134 bitrate_estimator_->IncomingPacketFeedbackVector(packet_feedback_vector); |
| 137 } | 135 } |
| 138 | 136 |
| 139 void TransportFeedbackAdapter::OnReceiveBitrateChanged( | |
| 140 const std::vector<uint32_t>& ssrcs, | |
| 141 uint32_t bitrate) { | |
| 142 bitrate_controller_->UpdateDelayBasedEstimate(bitrate); | |
| 143 } | |
| 144 | |
| 145 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, | 137 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, |
| 146 int64_t max_rtt_ms) { | 138 int64_t max_rtt_ms) { |
| 147 RTC_DCHECK(bitrate_estimator_.get() != nullptr); | 139 RTC_DCHECK(bitrate_estimator_.get() != nullptr); |
| 148 bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); | 140 bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); |
| 149 } | 141 } |
| 150 | 142 |
| 151 } // namespace webrtc | 143 } // namespace webrtc |
| OLD | NEW |