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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 void TransportFeedbackAdapter::SetBitrateEstimator( | 44 void TransportFeedbackAdapter::SetBitrateEstimator( |
45 RemoteBitrateEstimator* rbe) { | 45 RemoteBitrateEstimator* rbe) { |
46 if (bitrate_estimator_.get() != rbe) { | 46 if (bitrate_estimator_.get() != rbe) { |
47 bitrate_estimator_.reset(rbe); | 47 bitrate_estimator_.reset(rbe); |
48 process_thread_->RegisterModule(rbe); | 48 process_thread_->RegisterModule(rbe); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 void TransportFeedbackAdapter::OnPacketSent(const PacketInfo& info) { | 52 void TransportFeedbackAdapter::OnSentPacket(const PacketInfo& info) { |
53 rtc::CritScope cs(&lock_); | 53 rtc::CritScope cs(&lock_); |
54 send_time_history_.AddAndRemoveOld(info); | 54 send_time_history_.AddAndRemoveOld(info); |
55 } | 55 } |
56 | 56 |
| 57 void TransportFeedbackAdapter::UpdateSendTime(uint16_t sequence_number, |
| 58 int64_t send_time_ms) { |
| 59 rtc::CritScope cs(&lock_); |
| 60 send_time_history_.UpdateSendTime(sequence_number, send_time_ms); |
| 61 } |
| 62 |
57 void TransportFeedbackAdapter::OnTransportFeedback( | 63 void TransportFeedbackAdapter::OnTransportFeedback( |
58 const rtcp::TransportFeedback& feedback) { | 64 const rtcp::TransportFeedback& feedback) { |
59 int64_t timestamp_us = feedback.GetBaseTimeUs(); | 65 int64_t timestamp_us = feedback.GetBaseTimeUs(); |
60 // Add timestamp deltas to a local time base selected on first packet arrival. | 66 // Add timestamp deltas to a local time base selected on first packet arrival. |
61 // This won't be the true time base, but makes it easier to manually inspect | 67 // This won't be the true time base, but makes it easier to manually inspect |
62 // time stamps. | 68 // time stamps. |
63 if (last_timestamp_us_ == kNoTimestamp) { | 69 if (last_timestamp_us_ == kNoTimestamp) { |
64 current_offset_ms_ = clock_->TimeInMilliseconds(); | 70 current_offset_ms_ = clock_->TimeInMilliseconds(); |
65 } else { | 71 } else { |
66 int64_t delta = timestamp_us - last_timestamp_us_; | 72 int64_t delta = timestamp_us - last_timestamp_us_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(bitrate); | 124 rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(bitrate); |
119 } | 125 } |
120 | 126 |
121 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, | 127 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, |
122 int64_t max_rtt_ms) { | 128 int64_t max_rtt_ms) { |
123 RTC_DCHECK(bitrate_estimator_.get() != nullptr); | 129 RTC_DCHECK(bitrate_estimator_.get() != nullptr); |
124 bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); | 130 bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); |
125 } | 131 } |
126 | 132 |
127 } // namespace webrtc | 133 } // namespace webrtc |
OLD | NEW |