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()}); | |
332 } | 334 } |
333 | 335 |
334 void CongestionController::Process() { | 336 void CongestionController::Process() { |
335 bitrate_controller_->Process(); | 337 bitrate_controller_->Process(); |
336 remote_bitrate_estimator_->Process(); | 338 remote_bitrate_estimator_->Process(); |
337 probe_controller_->Process(); | 339 probe_controller_->Process(); |
340 pacer_->Process(); | |
341 remote_estimator_proxy_.Process(); | |
338 MaybeTriggerOnNetworkChanged(); | 342 MaybeTriggerOnNetworkChanged(); |
danilchap
2017/01/16 17:09:39
look like it is this function that SetEstimatedBit
nisse-webrtc
2017/01/17 07:42:39
Reorder isn't enough, first call to MaybeTriggerOn
stefan-webrtc
2017/01/17 07:59:54
It might be a good idea to call MaybeTriggerOnNetw
nisse-webrtc
2017/01/17 08:39:35
Done.
| |
339 } | 343 } |
340 | 344 |
341 void CongestionController::MaybeTriggerOnNetworkChanged() { | 345 void CongestionController::MaybeTriggerOnNetworkChanged() { |
342 // TODO(perkj): |observer_| can be nullptr if the ctor that accepts a | 346 // TODO(perkj): |observer_| can be nullptr if the ctor that accepts a |
343 // BitrateObserver is used. Remove this check once the ctor is removed. | 347 // BitrateObserver is used. Remove this check once the ctor is removed. |
344 if (!observer_) | 348 if (!observer_) |
345 return; | 349 return; |
346 | 350 |
347 uint32_t bitrate_bps; | 351 uint32_t bitrate_bps; |
348 uint8_t fraction_loss; | 352 uint8_t fraction_loss; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
387 bool CongestionController::IsSendQueueFull() const { | 391 bool CongestionController::IsSendQueueFull() const { |
388 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 392 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
389 } | 393 } |
390 | 394 |
391 bool CongestionController::IsNetworkDown() const { | 395 bool CongestionController::IsNetworkDown() const { |
392 rtc::CritScope cs(&critsect_); | 396 rtc::CritScope cs(&critsect_); |
393 return network_state_ == kNetworkDown; | 397 return network_state_ == kNetworkDown; |
394 } | 398 } |
395 | 399 |
396 } // namespace webrtc | 400 } // namespace webrtc |
OLD | NEW |