| Index: webrtc/call/bitrate_allocator.cc
|
| diff --git a/webrtc/call/bitrate_allocator.cc b/webrtc/call/bitrate_allocator.cc
|
| index 5bd1a2c93edf6902da3e5002405e8a7bc47675aa..c3568df34c65a4595ccea2eb154b493cdeb73e57 100644
|
| --- a/webrtc/call/bitrate_allocator.cc
|
| +++ b/webrtc/call/bitrate_allocator.cc
|
| @@ -54,7 +54,9 @@
|
| last_rtt_(0),
|
| num_pause_events_(0),
|
| clock_(Clock::GetRealTimeClock()),
|
| - last_bwe_log_time_(0) {
|
| + last_bwe_log_time_(0),
|
| + total_requested_padding_bitrate_(0),
|
| + total_requested_min_bitrate_(0) {
|
| sequenced_checker_.Detach();
|
| }
|
|
|
| @@ -115,6 +117,7 @@
|
| config.media_ratio = MediaRatio(allocated_bitrate, protection_bitrate);
|
| config.allocated_bitrate_bps = allocated_bitrate;
|
| }
|
| + UpdateAllocationLimits();
|
| }
|
|
|
| void BitrateAllocator::AddObserver(BitrateAllocatorObserver* observer,
|
| @@ -167,11 +170,23 @@
|
| uint32_t total_requested_min_bitrate = 0;
|
|
|
| for (const auto& config : bitrate_observer_configs_) {
|
| + uint32_t stream_padding = config.pad_up_bitrate_bps;
|
| if (config.enforce_min_bitrate) {
|
| total_requested_min_bitrate += config.min_bitrate_bps;
|
| - }
|
| - total_requested_padding_bitrate += config.pad_up_bitrate_bps;
|
| - }
|
| + } else if (config.allocated_bitrate_bps == 0) {
|
| + stream_padding =
|
| + std::max(MinBitrateWithHysteresis(config), stream_padding);
|
| + }
|
| + total_requested_padding_bitrate += stream_padding;
|
| + }
|
| +
|
| + if (total_requested_padding_bitrate == total_requested_padding_bitrate_ &&
|
| + total_requested_min_bitrate == total_requested_min_bitrate_) {
|
| + return;
|
| + }
|
| +
|
| + total_requested_min_bitrate_ = total_requested_min_bitrate;
|
| + total_requested_padding_bitrate_ = total_requested_padding_bitrate;
|
|
|
| LOG(LS_INFO) << "UpdateAllocationLimits : total_requested_min_bitrate: "
|
| << total_requested_min_bitrate
|
| @@ -416,8 +431,9 @@
|
| static_cast<uint32_t>(bitrate_observer_configs_.size());
|
| for (const auto& observer_config : bitrate_observer_configs_) {
|
| if (observer_config.min_bitrate_bps + extra_bitrate_per_observer <
|
| - MinBitrateWithHysteresis(observer_config))
|
| + MinBitrateWithHysteresis(observer_config)) {
|
| return false;
|
| + }
|
| }
|
| return true;
|
| }
|
|
|