OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 |
11 #include "webrtc/modules/congestion_controller/include/receive_side_congestion_c
ontroller.h" | 11 #include "webrtc/modules/congestion_controller/include/receive_side_congestion_c
ontroller.h" |
12 | 12 |
13 #include "webrtc/base/logging.h" | 13 #include "webrtc/base/logging.h" |
| 14 #include "webrtc/modules/pacing/packet_router.h" |
14 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" | 15 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
15 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" | 16 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
16 | 17 |
17 namespace webrtc { | 18 namespace webrtc { |
18 | 19 |
19 namespace { | 20 namespace { |
20 static const uint32_t kTimeOffsetSwitchThreshold = 30; | 21 static const uint32_t kTimeOffsetSwitchThreshold = 30; |
21 } // namespace | 22 } // namespace |
22 | 23 |
23 ReceiveSideCongestionController::WrappingBitrateEstimator:: | 24 ReceiveSideCongestionController::WrappingBitrateEstimator:: |
(...skipping 84 matching lines...) Loading... |
108 if (using_absolute_send_time_) { | 109 if (using_absolute_send_time_) { |
109 rbe_.reset(new RemoteBitrateEstimatorAbsSendTime(observer_, clock_)); | 110 rbe_.reset(new RemoteBitrateEstimatorAbsSendTime(observer_, clock_)); |
110 } else { | 111 } else { |
111 rbe_.reset(new RemoteBitrateEstimatorSingleStream(observer_, clock_)); | 112 rbe_.reset(new RemoteBitrateEstimatorSingleStream(observer_, clock_)); |
112 } | 113 } |
113 rbe_->SetMinBitrate(min_bitrate_bps_); | 114 rbe_->SetMinBitrate(min_bitrate_bps_); |
114 } | 115 } |
115 | 116 |
116 ReceiveSideCongestionController::ReceiveSideCongestionController( | 117 ReceiveSideCongestionController::ReceiveSideCongestionController( |
117 const Clock* clock, | 118 const Clock* clock, |
118 RemoteBitrateObserver* remote_bitrate_observer, | |
119 PacketRouter* packet_router) | 119 PacketRouter* packet_router) |
120 : remote_bitrate_estimator_(remote_bitrate_observer, clock), | 120 : remote_bitrate_estimator_(packet_router, clock), |
121 remote_estimator_proxy_(clock, packet_router) {} | 121 remote_estimator_proxy_(clock, packet_router) {} |
122 | 122 |
123 void ReceiveSideCongestionController::OnReceivedPacket( | 123 void ReceiveSideCongestionController::OnReceivedPacket( |
124 int64_t arrival_time_ms, | 124 int64_t arrival_time_ms, |
125 size_t payload_size, | 125 size_t payload_size, |
126 const RTPHeader& header) { | 126 const RTPHeader& header) { |
127 // Send-side BWE. | 127 // Send-side BWE. |
128 if (header.extension.hasTransportSequenceNumber) { | 128 if (header.extension.hasTransportSequenceNumber) { |
129 remote_estimator_proxy_.IncomingPacket(arrival_time_ms, payload_size, | 129 remote_estimator_proxy_.IncomingPacket(arrival_time_ms, payload_size, |
130 header); | 130 header); |
(...skipping 34 matching lines...) Loading... |
165 | 165 |
166 int64_t ReceiveSideCongestionController::TimeUntilNextProcess() { | 166 int64_t ReceiveSideCongestionController::TimeUntilNextProcess() { |
167 return remote_bitrate_estimator_.TimeUntilNextProcess(); | 167 return remote_bitrate_estimator_.TimeUntilNextProcess(); |
168 } | 168 } |
169 | 169 |
170 void ReceiveSideCongestionController::Process() { | 170 void ReceiveSideCongestionController::Process() { |
171 remote_bitrate_estimator_.Process(); | 171 remote_bitrate_estimator_.Process(); |
172 } | 172 } |
173 | 173 |
174 } // namespace webrtc | 174 } // namespace webrtc |
OLD | NEW |