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 25 matching lines...) Expand all Loading... |
36 return lhs.arrival_time_ms < rhs.arrival_time_ms; | 36 return lhs.arrival_time_ms < rhs.arrival_time_ms; |
37 if (lhs.send_time_ms != rhs.send_time_ms) | 37 if (lhs.send_time_ms != rhs.send_time_ms) |
38 return lhs.send_time_ms < rhs.send_time_ms; | 38 return lhs.send_time_ms < rhs.send_time_ms; |
39 return lhs.sequence_number < rhs.sequence_number; | 39 return lhs.sequence_number < rhs.sequence_number; |
40 } | 40 } |
41 }; | 41 }; |
42 | 42 |
43 TransportFeedbackAdapter::TransportFeedbackAdapter( | 43 TransportFeedbackAdapter::TransportFeedbackAdapter( |
44 Clock* clock, | 44 Clock* clock, |
45 BitrateController* bitrate_controller) | 45 BitrateController* bitrate_controller) |
46 : transport_overhead_bytes_per_packet_(0), | 46 : send_side_bwe_with_overhead_(webrtc::field_trial::FindFullName( |
| 47 "WebRTC-SendSideBwe-WithOverhead") == "Enabled"), |
| 48 transport_overhead_bytes_per_packet_(0), |
47 send_time_history_(clock, kSendTimeHistoryWindowMs), | 49 send_time_history_(clock, kSendTimeHistoryWindowMs), |
48 clock_(clock), | 50 clock_(clock), |
49 current_offset_ms_(kNoTimestamp), | 51 current_offset_ms_(kNoTimestamp), |
50 last_timestamp_us_(kNoTimestamp), | 52 last_timestamp_us_(kNoTimestamp), |
51 bitrate_controller_(bitrate_controller) {} | 53 bitrate_controller_(bitrate_controller) {} |
52 | 54 |
53 TransportFeedbackAdapter::~TransportFeedbackAdapter() {} | 55 TransportFeedbackAdapter::~TransportFeedbackAdapter() {} |
54 | 56 |
55 void TransportFeedbackAdapter::InitBwe() { | 57 void TransportFeedbackAdapter::InitBwe() { |
56 rtc::CritScope cs(&bwe_lock_); | 58 rtc::CritScope cs(&bwe_lock_); |
57 delay_based_bwe_.reset(new DelayBasedBwe(clock_)); | 59 delay_based_bwe_.reset(new DelayBasedBwe(clock_)); |
58 } | 60 } |
59 | 61 |
60 void TransportFeedbackAdapter::AddPacket(uint16_t sequence_number, | 62 void TransportFeedbackAdapter::AddPacket(uint16_t sequence_number, |
61 size_t length, | 63 size_t length, |
62 int probe_cluster_id) { | 64 int probe_cluster_id) { |
63 rtc::CritScope cs(&lock_); | 65 rtc::CritScope cs(&lock_); |
64 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead") == | 66 if (send_side_bwe_with_overhead_) { |
65 "Enabled") { | |
66 length += transport_overhead_bytes_per_packet_; | 67 length += transport_overhead_bytes_per_packet_; |
67 } | 68 } |
68 send_time_history_.AddAndRemoveOld(sequence_number, length, probe_cluster_id); | 69 send_time_history_.AddAndRemoveOld(sequence_number, length, probe_cluster_id); |
69 } | 70 } |
70 | 71 |
71 void TransportFeedbackAdapter::OnSentPacket(uint16_t sequence_number, | 72 void TransportFeedbackAdapter::OnSentPacket(uint16_t sequence_number, |
72 int64_t send_time_ms) { | 73 int64_t send_time_ms) { |
73 rtc::CritScope cs(&lock_); | 74 rtc::CritScope cs(&lock_); |
74 send_time_history_.OnSentPacket(sequence_number, send_time_ms); | 75 send_time_history_.OnSentPacket(sequence_number, send_time_ms); |
75 } | 76 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return last_packet_feedback_vector_; | 163 return last_packet_feedback_vector_; |
163 } | 164 } |
164 | 165 |
165 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, | 166 void TransportFeedbackAdapter::OnRttUpdate(int64_t avg_rtt_ms, |
166 int64_t max_rtt_ms) { | 167 int64_t max_rtt_ms) { |
167 rtc::CritScope cs(&bwe_lock_); | 168 rtc::CritScope cs(&bwe_lock_); |
168 delay_based_bwe_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); | 169 delay_based_bwe_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); |
169 } | 170 } |
170 | 171 |
171 } // namespace webrtc | 172 } // namespace webrtc |
OLD | NEW |