Default disables legacy overhead calculation.

This ensures that overhead calculation is correct by default when
enabling the WebRTC-SendSideBwe-WithOverhead field trial.

We keep the legacy mode to allow downstream projects already relying on
WebRTC-SendSideBwe-WithOverhead to preserve the current behavior.

Bug: webrtc:6762
Change-Id: I84369c760d59345a48ec352997dbed6d2db21d13
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167862
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30424}
This commit is contained in:
Sebastian Jansson 2020-01-30 14:09:48 +01:00 committed by Commit Bot
parent 5dca3f1336
commit bef818d4d9
3 changed files with 11 additions and 2 deletions

View File

@ -154,7 +154,7 @@ AudioSendStream::AudioSendStream(
channel_send_(std::move(channel_send)),
event_log_(event_log),
use_legacy_overhead_calculation_(
!field_trial::IsDisabled("WebRTC-Audio-LegacyOverhead")),
field_trial::IsEnabled("WebRTC-Audio-LegacyOverhead")),
bitrate_allocator_(bitrate_allocator),
rtp_transport_(rtp_transport),
rtp_rtcp_module_(channel_send_->GetRtpRtcp()),

View File

@ -100,7 +100,7 @@ PacingController::PacingController(Clock* clock,
small_first_probe_packet_(
IsEnabled(*field_trials_, "WebRTC-Pacer-SmallFirstProbePacket")),
ignore_transport_overhead_(
!IsDisabled(*field_trials_, "WebRTC-Pacer-IgnoreTransportOverhead")),
IsEnabled(*field_trials_, "WebRTC-Pacer-IgnoreTransportOverhead")),
min_packet_limit_(kDefaultMinPacketLimit),
transport_overhead_per_packet_(DataSize::Zero()),
last_timestamp_(clock_->CurrentTime()),

View File

@ -260,6 +260,15 @@ void RoundRobinPacketQueue::SetIncludeOverhead() {
}
void RoundRobinPacketQueue::SetTransportOverhead(DataSize overhead_per_packet) {
if (include_overhead_) {
DataSize previous_overhead = transport_overhead_per_packet_;
// We need to update the size to reflect overhead for existing packets.
for (const auto& stream : streams_) {
int packets = stream.second.packet_queue.size();
size_ -= packets * previous_overhead;
size_ += packets * overhead_per_packet;
}
}
transport_overhead_per_packet_ = overhead_per_packet;
}