OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 }; | 147 }; |
148 | 148 |
149 } // namespace | 149 } // namespace |
150 | 150 |
151 CongestionController::CongestionController( | 151 CongestionController::CongestionController( |
152 Clock* clock, | 152 Clock* clock, |
153 Observer* observer, | 153 Observer* observer, |
154 RemoteBitrateObserver* remote_bitrate_observer, | 154 RemoteBitrateObserver* remote_bitrate_observer, |
155 RtcEventLog* event_log, | 155 RtcEventLog* event_log, |
156 PacketRouter* packet_router) | 156 PacketRouter* packet_router) |
157 : CongestionController( | 157 : CongestionController(clock, |
158 clock, | 158 observer, |
159 observer, | 159 remote_bitrate_observer, |
160 remote_bitrate_observer, | 160 event_log, |
161 event_log, | 161 packet_router, |
162 packet_router, | 162 std::unique_ptr<PacedSender>( |
163 std::unique_ptr<PacedSender>(new PacedSender(clock, packet_router))) { | 163 new PacedSender(clock, packet_router, this))) {} |
164 } | |
165 | 164 |
166 CongestionController::CongestionController( | 165 CongestionController::CongestionController( |
167 Clock* clock, | 166 Clock* clock, |
168 Observer* observer, | 167 Observer* observer, |
169 RemoteBitrateObserver* remote_bitrate_observer, | 168 RemoteBitrateObserver* remote_bitrate_observer, |
170 RtcEventLog* event_log, | 169 RtcEventLog* event_log, |
171 PacketRouter* packet_router, | 170 PacketRouter* packet_router, |
172 std::unique_ptr<PacedSender> pacer) | 171 std::unique_ptr<PacedSender> pacer) |
173 : clock_(clock), | 172 : clock_(clock), |
174 observer_(observer), | 173 observer_(observer), |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 remote_bitrate_estimator_->TimeUntilNextProcess()); | 324 remote_bitrate_estimator_->TimeUntilNextProcess()); |
326 } | 325 } |
327 | 326 |
328 void CongestionController::Process() { | 327 void CongestionController::Process() { |
329 bitrate_controller_->Process(); | 328 bitrate_controller_->Process(); |
330 remote_bitrate_estimator_->Process(); | 329 remote_bitrate_estimator_->Process(); |
331 probe_controller_->Process(); | 330 probe_controller_->Process(); |
332 MaybeTriggerOnNetworkChanged(); | 331 MaybeTriggerOnNetworkChanged(); |
333 } | 332 } |
334 | 333 |
| 334 void CongestionController::OnProbingClusterCreated(int cluster_id, |
| 335 int min_bytes, |
| 336 int min_probes) { |
| 337 transport_feedback_adapter_.OnProbingClusterCreated(cluster_id, min_bytes, |
| 338 min_probes); |
| 339 } |
| 340 |
335 void CongestionController::MaybeTriggerOnNetworkChanged() { | 341 void CongestionController::MaybeTriggerOnNetworkChanged() { |
336 // TODO(perkj): |observer_| can be nullptr if the ctor that accepts a | 342 // TODO(perkj): |observer_| can be nullptr if the ctor that accepts a |
337 // BitrateObserver is used. Remove this check once the ctor is removed. | 343 // BitrateObserver is used. Remove this check once the ctor is removed. |
338 if (!observer_) | 344 if (!observer_) |
339 return; | 345 return; |
340 | 346 |
341 uint32_t bitrate_bps; | 347 uint32_t bitrate_bps; |
342 uint8_t fraction_loss; | 348 uint8_t fraction_loss; |
343 int64_t rtt; | 349 int64_t rtt; |
344 bool estimate_changed = bitrate_controller_->GetNetworkParameters( | 350 bool estimate_changed = bitrate_controller_->GetNetworkParameters( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 bool CongestionController::IsSendQueueFull() const { | 387 bool CongestionController::IsSendQueueFull() const { |
382 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 388 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
383 } | 389 } |
384 | 390 |
385 bool CongestionController::IsNetworkDown() const { | 391 bool CongestionController::IsNetworkDown() const { |
386 rtc::CritScope cs(&critsect_); | 392 rtc::CritScope cs(&critsect_); |
387 return network_state_ == kNetworkDown; | 393 return network_state_ == kNetworkDown; |
388 } | 394 } |
389 | 395 |
390 } // namespace webrtc | 396 } // namespace webrtc |
OLD | NEW |