Adds allocated rate without feedback to new congestion controller.
When bitrate is allocated to streams that does not have packet feedback,
the allocated bitrate should be included in the estimate. This was
previously only implemented for the old congestion controller and not
for the new task queue based version.
To make the behavior more robust, the responsibility for tracking this
is moved to BitrateAllocator where it's handled consistently for
multiple streams without feedback.
Bug: webrtc:9586, webrtc:8243
Change-Id: I8af7fec23e1bdc08cc61cf1b4ff10461c3711fb0
Reviewed-on: https://webrtc-review.googlesource.com/102681
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24905}diff --git a/call/bitrate_allocator.cc b/call/bitrate_allocator.cc
index c7049ba..acb19ae 100644
--- a/call/bitrate_allocator.cc
+++ b/call/bitrate_allocator.cc
@@ -60,6 +60,7 @@
total_requested_padding_bitrate_(0),
total_requested_min_bitrate_(0),
total_requested_max_bitrate_(0),
+ allocated_without_feedback_(0),
has_packet_feedback_(false),
bitrate_allocation_strategy_(nullptr),
transmission_max_bitrate_multiplier_(
@@ -191,6 +192,7 @@
uint32_t total_requested_min_bitrate = 0;
uint32_t total_requested_max_bitrate = 0;
bool has_packet_feedback = false;
+ uint32_t allocated_without_feedback = 0;
for (const auto& config : bitrate_observer_configs_) {
uint32_t stream_padding = config.pad_up_bitrate_bps;
if (config.enforce_min_bitrate) {
@@ -203,11 +205,16 @@
total_requested_max_bitrate += config.max_bitrate_bps;
if (config.allocated_bitrate_bps > 0 && config.has_packet_feedback)
has_packet_feedback = true;
+ // TODO(srte): Remove field trial check.
+ if (!config.has_packet_feedback &&
+ field_trial::IsEnabled("WebRTC-Audio-ABWENoTWCC"))
+ allocated_without_feedback += config.allocated_bitrate_bps;
}
if (total_requested_padding_bitrate == total_requested_padding_bitrate_ &&
total_requested_min_bitrate == total_requested_min_bitrate_ &&
total_requested_max_bitrate == total_requested_max_bitrate_ &&
+ allocated_without_feedback == allocated_without_feedback_ &&
has_packet_feedback == has_packet_feedback_) {
return;
}
@@ -215,6 +222,7 @@
total_requested_min_bitrate_ = total_requested_min_bitrate;
total_requested_padding_bitrate_ = total_requested_padding_bitrate;
total_requested_max_bitrate_ = total_requested_max_bitrate;
+ allocated_without_feedback_ = allocated_without_feedback;
has_packet_feedback_ = has_packet_feedback;
RTC_LOG(LS_INFO) << "UpdateAllocationLimits : total_requested_min_bitrate: "
@@ -225,7 +233,8 @@
<< total_requested_max_bitrate << "bps";
limit_observer_->OnAllocationLimitsChanged(
total_requested_min_bitrate, total_requested_padding_bitrate,
- total_requested_max_bitrate, has_packet_feedback);
+ total_requested_max_bitrate, allocated_without_feedback,
+ has_packet_feedback);
}
void BitrateAllocator::RemoveObserver(BitrateAllocatorObserver* observer) {