Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: webrtc/call/congestion_controller.cc

Issue 1413663004: Set pacer target bitrate to max of bwe and bitrate allocation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed typo Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/bitrate_controller/bitrate_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/congestion_controller.cc
diff --git a/webrtc/call/congestion_controller.cc b/webrtc/call/congestion_controller.cc
index 52704154bbdc9576da90798d87335af9bfb91d9d..27185c162d91a26837073a7884fd9a41a9666771 100644
--- a/webrtc/call/congestion_controller.cc
+++ b/webrtc/call/congestion_controller.cc
@@ -282,16 +282,22 @@ void CongestionController::SignalNetworkState(NetworkState state) {
void CongestionController::OnNetworkChanged(uint32_t target_bitrate_bps,
uint8_t fraction_loss,
int64_t rtt) {
- bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt);
+ uint32_t allocated_bitrate_bps = bitrate_allocator_->OnNetworkChanged(
+ target_bitrate_bps, fraction_loss, rtt);
int pad_up_to_bitrate_bps = 0;
{
rtc::CritScope lock(&encoder_crit_);
for (const auto& encoder : encoders_)
pad_up_to_bitrate_bps += encoder->GetPaddingNeededBps();
}
+ // Allocated bitrate might be higher than bitrate estimate if enforcing min
+ // bitrate, or lower if estimate is higher than the sum of max bitrates, so
+ // set the pacer bitrate to the maximum of the two.
+ uint32_t pacer_bitrate_bps =
+ std::max(target_bitrate_bps, allocated_bitrate_bps);
pacer_->UpdateBitrate(
- target_bitrate_bps / 1000,
- PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000,
+ pacer_bitrate_bps / 1000,
+ PacedSender::kDefaultPaceMultiplier * pacer_bitrate_bps / 1000,
pad_up_to_bitrate_bps / 1000);
}
« no previous file with comments | « no previous file | webrtc/modules/bitrate_controller/bitrate_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698