From ce79f873e72b30c26ef63cfbc54a71f9afbec6e9 Mon Sep 17 00:00:00 2001 From: Per Kjellander Date: Fri, 2 Dec 2022 16:07:09 +0100 Subject: [PATCH] Update Call Scenario test framwork to use defaults from Chrome MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Default send transport wide sequence numbers on audio Use 32kbit/s audio. Pace in bursts 40ms, See chromium:1354491 Bug: none Change-Id: I40b1305ce71478749723a53f6cc84669ddf930e2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285883 Reviewed-by: Jakob Ivarsson‎ Reviewed-by: Erik Språng Commit-Queue: Per Kjellander Cr-Commit-Position: refs/heads/main@{#38827} --- test/scenario/audio_stream.cc | 11 ++++++----- test/scenario/call_client.cc | 1 + test/scenario/scenario_config.h | 11 ++++++++--- test/scenario/stats_collection_unittest.cc | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/test/scenario/audio_stream.cc b/test/scenario/audio_stream.cc index 891ef4b4a6..3c94d7911f 100644 --- a/test/scenario/audio_stream.cc +++ b/test/scenario/audio_stream.cc @@ -93,9 +93,10 @@ SendAudioStream::SendAudioStream( RTC_DCHECK_LE(config.source.channels, 2); send_config.encoder_factory = encoder_factory; - if (config.encoder.fixed_rate) + bool use_fixed_rate = !config.encoder.min_rate && !config.encoder.max_rate; + if (use_fixed_rate) send_config.send_codec_spec->target_bitrate_bps = - config.encoder.fixed_rate->bps(); + config.encoder.fixed_rate.bps(); if (!config.adapt.binary_proto.empty()) { send_config.audio_network_adaptor_config = config.adapt.binary_proto; } else if (config.network_adaptation) { @@ -106,9 +107,9 @@ SendAudioStream::SendAudioStream( config.stream.in_bandwidth_estimation) { DataRate min_rate = DataRate::Infinity(); DataRate max_rate = DataRate::Infinity(); - if (config.encoder.fixed_rate) { - min_rate = *config.encoder.fixed_rate; - max_rate = *config.encoder.fixed_rate; + if (use_fixed_rate) { + min_rate = config.encoder.fixed_rate; + max_rate = config.encoder.fixed_rate; } else { min_rate = *config.encoder.min_rate; max_rate = *config.encoder.max_rate; diff --git a/test/scenario/call_client.cc b/test/scenario/call_client.cc index c9babc7b79..46f593898d 100644 --- a/test/scenario/call_client.cc +++ b/test/scenario/call_client.cc @@ -70,6 +70,7 @@ Call* CreateCall(TimeController* time_controller, call_config.task_queue_factory = time_controller->GetTaskQueueFactory(); call_config.network_controller_factory = network_controller_factory; call_config.audio_state = audio_state; + call_config.pacer_burst_interval = config.pacer_burst_interval; call_config.trials = config.field_trials; Clock* clock = time_controller->GetClock(); return Call::Create(call_config, clock, diff --git a/test/scenario/scenario_config.h b/test/scenario/scenario_config.h index be0d0b3589..9ce99401d7 100644 --- a/test/scenario/scenario_config.h +++ b/test/scenario/scenario_config.h @@ -53,6 +53,10 @@ struct TransportControllerConfig { struct CallClientConfig { TransportControllerConfig transport; + // Allows the pacer to send out multiple packets in a burst. + // The number of bites that can be sent in one burst is pacer_burst_interval * + // current bwe. 40ms is the default Chrome setting. + TimeDelta pacer_burst_interval = TimeDelta::Millis(40); const FieldTrialsView* field_trials = nullptr; }; @@ -194,7 +198,8 @@ struct AudioStreamConfig { ~Encoder(); bool allocate_bitrate = false; bool enable_dtx = false; - absl::optional fixed_rate; + DataRate fixed_rate = DataRate::KilobitsPerSec(32); + // Overrides fixed rate. absl::optional min_rate; absl::optional max_rate; TimeDelta initial_frame_length = TimeDelta::Millis(20); @@ -203,8 +208,8 @@ struct AudioStreamConfig { Stream(); Stream(const Stream&); ~Stream(); - bool abs_send_time = false; - bool in_bandwidth_estimation = false; + bool abs_send_time = true; + bool in_bandwidth_estimation = true; } stream; struct Rendering { std::string sync_group; diff --git a/test/scenario/stats_collection_unittest.cc b/test/scenario/stats_collection_unittest.cc index 3db1100a2a..9f46f10073 100644 --- a/test/scenario/stats_collection_unittest.cc +++ b/test/scenario/stats_collection_unittest.cc @@ -91,7 +91,7 @@ TEST(ScenarioAnalyzerTest, PsnrIsLowWhenNetworkIsBad) { // might change due to changes in configuration and encoder etc. EXPECT_NEAR(analyzer.stats().psnr_with_freeze.Mean(), 20, 10); EXPECT_NEAR(stats.call.stats().target_rate.Mean().kbps(), 75, 50); - EXPECT_NEAR(stats.video_send.stats().media_bitrate.Mean().kbps(), 100, 50); + EXPECT_NEAR(stats.video_send.stats().media_bitrate.Mean().kbps(), 70, 30); EXPECT_NEAR(stats.video_receive.stats().resolution.Mean(), 180, 10); EXPECT_NEAR(stats.audio_receive.stats().jitter_buffer.Mean().ms(), 250, 200); }