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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if (estimate_changed) { | 340 if (estimate_changed) { |
341 pacer_->SetEstimatedBitrate(bitrate_bps); | 341 pacer_->SetEstimatedBitrate(bitrate_bps); |
342 probe_controller_->SetEstimatedBitrate(bitrate_bps); | 342 probe_controller_->SetEstimatedBitrate(bitrate_bps); |
343 retransmission_rate_limiter_->SetMaxRate(bitrate_bps); | 343 retransmission_rate_limiter_->SetMaxRate(bitrate_bps); |
344 } | 344 } |
345 | 345 |
346 bitrate_bps = IsNetworkDown() || IsSendQueueFull() ? 0 : bitrate_bps; | 346 bitrate_bps = IsNetworkDown() || IsSendQueueFull() ? 0 : bitrate_bps; |
347 | 347 |
348 if (HasNetworkParametersToReportChanged(bitrate_bps, fraction_loss, rtt)) { | 348 if (HasNetworkParametersToReportChanged(bitrate_bps, fraction_loss, rtt)) { |
349 observer_->OnNetworkChanged(bitrate_bps, fraction_loss, rtt); | 349 observer_->OnNetworkChanged(bitrate_bps, fraction_loss, rtt); |
350 remote_estimator_proxy_.OnBitrateChanged(bitrate_bps); | |
351 } | 350 } |
352 } | 351 } |
353 | 352 |
354 bool CongestionController::HasNetworkParametersToReportChanged( | 353 bool CongestionController::HasNetworkParametersToReportChanged( |
355 uint32_t bitrate_bps, | 354 uint32_t bitrate_bps, |
356 uint8_t fraction_loss, | 355 uint8_t fraction_loss, |
357 int64_t rtt) { | 356 int64_t rtt) { |
358 rtc::CritScope cs(&critsect_); | 357 rtc::CritScope cs(&critsect_); |
359 bool changed = | 358 bool changed = |
360 last_reported_bitrate_bps_ != bitrate_bps || | 359 last_reported_bitrate_bps_ != bitrate_bps || |
(...skipping 12 matching lines...) Expand all Loading... |
373 bool CongestionController::IsSendQueueFull() const { | 372 bool CongestionController::IsSendQueueFull() const { |
374 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 373 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
375 } | 374 } |
376 | 375 |
377 bool CongestionController::IsNetworkDown() const { | 376 bool CongestionController::IsNetworkDown() const { |
378 rtc::CritScope cs(&critsect_); | 377 rtc::CritScope cs(&critsect_); |
379 return network_state_ == kNetworkDown; | 378 return network_state_ == kNetworkDown; |
380 } | 379 } |
381 | 380 |
382 } // namespace webrtc | 381 } // namespace webrtc |
OLD | NEW |