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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 transport_feedback_adapter_.OnSentPacket(sent_packet.packet_id, | 320 transport_feedback_adapter_.OnSentPacket(sent_packet.packet_id, |
321 sent_packet.send_time_ms); | 321 sent_packet.send_time_ms); |
322 } | 322 } |
323 | 323 |
324 void CongestionController::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { | 324 void CongestionController::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) { |
325 remote_bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); | 325 remote_bitrate_estimator_->OnRttUpdate(avg_rtt_ms, max_rtt_ms); |
326 transport_feedback_adapter_.OnRttUpdate(avg_rtt_ms, max_rtt_ms); | 326 transport_feedback_adapter_.OnRttUpdate(avg_rtt_ms, max_rtt_ms); |
327 } | 327 } |
328 | 328 |
329 int64_t CongestionController::TimeUntilNextProcess() { | 329 int64_t CongestionController::TimeUntilNextProcess() { |
330 return std::min({bitrate_controller_->TimeUntilNextProcess(), | 330 return std::min(bitrate_controller_->TimeUntilNextProcess(), |
331 remote_bitrate_estimator_->TimeUntilNextProcess(), | 331 remote_bitrate_estimator_->TimeUntilNextProcess()); |
332 pacer_->TimeUntilNextProcess(), | |
333 remote_estimator_proxy_.TimeUntilNextProcess()}); | |
334 } | 332 } |
335 | 333 |
336 void CongestionController::Process() { | 334 void CongestionController::Process() { |
337 bitrate_controller_->Process(); | 335 bitrate_controller_->Process(); |
338 remote_bitrate_estimator_->Process(); | 336 remote_bitrate_estimator_->Process(); |
| 337 probe_controller_->Process(); |
339 MaybeTriggerOnNetworkChanged(); | 338 MaybeTriggerOnNetworkChanged(); |
340 probe_controller_->Process(); | |
341 pacer_->Process(); | |
342 remote_estimator_proxy_.Process(); | |
343 } | 339 } |
344 | 340 |
345 void CongestionController::MaybeTriggerOnNetworkChanged() { | 341 void CongestionController::MaybeTriggerOnNetworkChanged() { |
346 // 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 |
347 // BitrateObserver is used. Remove this check once the ctor is removed. | 343 // BitrateObserver is used. Remove this check once the ctor is removed. |
348 if (!observer_) | 344 if (!observer_) |
349 return; | 345 return; |
350 | 346 |
351 uint32_t bitrate_bps; | 347 uint32_t bitrate_bps; |
352 uint8_t fraction_loss; | 348 uint8_t fraction_loss; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 bool CongestionController::IsSendQueueFull() const { | 387 bool CongestionController::IsSendQueueFull() const { |
392 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 388 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
393 } | 389 } |
394 | 390 |
395 bool CongestionController::IsNetworkDown() const { | 391 bool CongestionController::IsNetworkDown() const { |
396 rtc::CritScope cs(&critsect_); | 392 rtc::CritScope cs(&critsect_); |
397 return network_state_ == kNetworkDown; | 393 return network_state_ == kNetworkDown; |
398 } | 394 } |
399 | 395 |
400 } // namespace webrtc | 396 } // namespace webrtc |
OLD | NEW |