From 6ef59d1ced564efd9db76d6d2396c67eb0e65884 Mon Sep 17 00:00:00 2001 From: Evan Shrubsole Date: Wed, 8 Jan 2020 16:45:08 +0100 Subject: [PATCH] Don't pace audio by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After experimentation, not pacing audio is better. This is controlled by the field trial WebRTC-Pacer-BlockAudio. This change keeps the flag, but changes the behaviour such that it defaults to Disabled. However, audio can still be paced if one chooses by enabling the field trial. Bug: webrtc:11257 Change-Id: I5b23a82bb6708c007cf8dfb40065c821eefdc4e3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165381 Commit-Queue: Evan Shrubsole Reviewed-by: Per Kjellander Reviewed-by: Christoffer Rodbro Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/master@{#30262} --- modules/pacing/pacing_controller.cc | 4 ++-- modules/pacing/pacing_controller_unittest.cc | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/pacing/pacing_controller.cc b/modules/pacing/pacing_controller.cc index e346a838f5..e6dd7ac93a 100644 --- a/modules/pacing/pacing_controller.cc +++ b/modules/pacing/pacing_controller.cc @@ -96,7 +96,7 @@ PacingController::PacingController(Clock* clock, !IsDisabled(*field_trials_, "WebRTC-Pacer-DrainQueue")), send_padding_if_silent_( IsEnabled(*field_trials_, "WebRTC-Pacer-PadInSilence")), - pace_audio_(!IsDisabled(*field_trials_, "WebRTC-Pacer-BlockAudio")), + pace_audio_(IsEnabled(*field_trials_, "WebRTC-Pacer-BlockAudio")), small_first_probe_packet_( IsEnabled(*field_trials_, "WebRTC-Pacer-SmallFirstProbePacket")), send_side_bwe_with_overhead_( @@ -600,7 +600,7 @@ std::unique_ptr PacingController::GetPendingPacket( bool is_probe = pacing_info.probe_cluster_id != PacedPacketInfo::kNotAProbe; if (!unpaced_audio_packet && !is_probe) { if (Congested()) { - // Don't send anyting if congested. + // Don't send anything if congested. return nullptr; } diff --git a/modules/pacing/pacing_controller_unittest.cc b/modules/pacing/pacing_controller_unittest.cc index e581e30492..2e4e564b7e 100644 --- a/modules/pacing/pacing_controller_unittest.cc +++ b/modules/pacing/pacing_controller_unittest.cc @@ -367,7 +367,8 @@ TEST_P(PacingControllerFieldTrialTest, PaddingInSilenceWithTrial) { pacer.ProcessPackets(); } -TEST_P(PacingControllerFieldTrialTest, DefaultCongestionWindowAffectsAudio) { +TEST_P(PacingControllerFieldTrialTest, CongestionWindowAffectsAudioInTrial) { + ScopedFieldTrials trial("WebRTC-Pacer-BlockAudio/Enabled/"); EXPECT_CALL(callback_, SendPadding).Times(0); PacingController pacer(&clock_, &callback_, nullptr, nullptr, GetParam()); pacer.SetPacingRates(DataRate::kbps(10000), DataRate::Zero()); @@ -394,8 +395,7 @@ TEST_P(PacingControllerFieldTrialTest, DefaultCongestionWindowAffectsAudio) { } TEST_P(PacingControllerFieldTrialTest, - CongestionWindowDoesNotAffectAudioInTrial) { - ScopedFieldTrials trial("WebRTC-Pacer-BlockAudio/Disabled/"); + DefaultCongestionWindowDoesNotAffectAudio) { EXPECT_CALL(callback_, SendPadding).Times(0); PacingController pacer(&clock_, &callback_, nullptr, nullptr, GetParam()); pacer.SetPacingRates(DataRate::bps(10000000), DataRate::Zero()); @@ -411,7 +411,8 @@ TEST_P(PacingControllerFieldTrialTest, ProcessNext(&pacer); } -TEST_P(PacingControllerFieldTrialTest, DefaultBudgetAffectsAudio) { +TEST_P(PacingControllerFieldTrialTest, BudgetAffectsAudioInTrial) { + ScopedFieldTrials trial("WebRTC-Pacer-BlockAudio/Enabled/"); PacingController pacer(&clock_, &callback_, nullptr, nullptr, GetParam()); DataRate pacing_rate = DataRate::bps(video.packet_size / 3 * 8 * kProcessIntervalsPerSecond); @@ -440,8 +441,7 @@ TEST_P(PacingControllerFieldTrialTest, DefaultBudgetAffectsAudio) { : PacingController::kMinSleepTime); } -TEST_P(PacingControllerFieldTrialTest, BudgetDoesNotAffectAudioInTrial) { - ScopedFieldTrials trial("WebRTC-Pacer-BlockAudio/Disabled/"); +TEST_P(PacingControllerFieldTrialTest, DefaultBudgetDoesNotAffectAudio) { EXPECT_CALL(callback_, SendPadding).Times(0); PacingController pacer(&clock_, &callback_, nullptr, nullptr, GetParam()); pacer.SetPacingRates(