`ExperimentalNs` removed + APM not depending anymore on `webrtc::Config`
Thanks to the elimination of `ExperimentalNs`, there is no need anymore
to pass `webrtc::Config` to build APM.
Hence, `AudioProcessingBuilder::Create(const webrtc::Config&)` is also
removed.
Bug: webrtc:5298
Change-Id: I0a3482376a7753434486fe564681f7b9f83939c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232128
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35025}
diff --git a/modules/audio_processing/test/audio_processing_builder_for_testing.cc b/modules/audio_processing/test/audio_processing_builder_for_testing.cc
index 05c3d3e..adf0c5d 100644
--- a/modules/audio_processing/test/audio_processing_builder_for_testing.cc
+++ b/modules/audio_processing/test/audio_processing_builder_for_testing.cc
@@ -24,16 +24,10 @@
#ifdef WEBRTC_EXCLUDE_AUDIO_PROCESSING_MODULE
rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilderForTesting::Create() {
- webrtc::Config config;
- return Create(config);
-}
-
-rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilderForTesting::Create(
- const webrtc::Config& config) {
return rtc::make_ref_counted<AudioProcessingImpl>(
- config, std::move(capture_post_processing_),
- std::move(render_pre_processing_), std::move(echo_control_factory_),
- std::move(echo_detector_), std::move(capture_analyzer_));
+ std::move(capture_post_processing_), std::move(render_pre_processing_),
+ std::move(echo_control_factory_), std::move(echo_detector_),
+ std::move(capture_analyzer_));
}
#else
@@ -44,13 +38,6 @@
return builder.Create();
}
-rtc::scoped_refptr<AudioProcessing> AudioProcessingBuilderForTesting::Create(
- const webrtc::Config& config) {
- AudioProcessingBuilder builder;
- TransferOwnershipsToBuilder(&builder);
- return builder.Create(config);
-}
-
#endif
void AudioProcessingBuilderForTesting::TransferOwnershipsToBuilder(
diff --git a/modules/audio_processing/test/audio_processing_builder_for_testing.h b/modules/audio_processing/test/audio_processing_builder_for_testing.h
index ba0f7b1..2d21248 100644
--- a/modules/audio_processing/test/audio_processing_builder_for_testing.h
+++ b/modules/audio_processing/test/audio_processing_builder_for_testing.h
@@ -63,7 +63,6 @@
// the Create function resets the AudioProcessingBuilderForTesting to its
// initial state.
rtc::scoped_refptr<AudioProcessing> Create();
- rtc::scoped_refptr<AudioProcessing> Create(const webrtc::Config& config);
private:
// Transfers the ownership to a non-testing builder.
diff --git a/modules/audio_processing/test/debug_dump_replayer.cc b/modules/audio_processing/test/debug_dump_replayer.cc
index b202469..cab6966 100644
--- a/modules/audio_processing/test/debug_dump_replayer.cc
+++ b/modules/audio_processing/test/debug_dump_replayer.cc
@@ -178,14 +178,13 @@
void DebugDumpReplayer::MaybeRecreateApm(const audioproc::Config& msg) {
// These configurations cannot be changed on the fly.
- Config config;
RTC_CHECK(msg.has_aec_delay_agnostic_enabled());
RTC_CHECK(msg.has_aec_extended_filter_enabled());
// We only create APM once, since changes on these fields should not
// happen in current implementation.
if (!apm_.get()) {
- apm_ = AudioProcessingBuilderForTesting().Create(config);
+ apm_ = AudioProcessingBuilderForTesting().Create();
}
}
diff --git a/modules/audio_processing/test/debug_dump_test.cc b/modules/audio_processing/test/debug_dump_test.cc
index 6c02571..b735160 100644
--- a/modules/audio_processing/test/debug_dump_test.cc
+++ b/modules/audio_processing/test/debug_dump_test.cc
@@ -47,13 +47,11 @@
const std::string& reverse_file_name,
int reverse_rate_hz,
int reverse_channels,
- const Config& config,
const std::string& dump_file_name,
bool enable_pre_amplifier);
// Constructor that uses default input files.
- explicit DebugDumpGenerator(const Config& config,
- const AudioProcessing::Config& apm_config);
+ explicit DebugDumpGenerator(const AudioProcessing::Config& apm_config);
~DebugDumpGenerator();
@@ -123,7 +121,6 @@
const std::string& reverse_file_name,
int reverse_rate_hz,
int reverse_channels,
- const Config& config,
const std::string& dump_file_name,
bool enable_pre_amplifier)
: input_config_(input_rate_hz, input_channels),
@@ -143,11 +140,10 @@
worker_queue_("debug_dump_generator_worker_queue"),
dump_file_name_(dump_file_name) {
AudioProcessingBuilderForTesting apm_builder;
- apm_ = apm_builder.Create(config);
+ apm_ = apm_builder.Create();
}
DebugDumpGenerator::DebugDumpGenerator(
- const Config& config,
const AudioProcessing::Config& apm_config)
: DebugDumpGenerator(ResourcePath("near32_stereo", "pcm"),
32000,
@@ -155,7 +151,6 @@
ResourcePath("far32_stereo", "pcm"),
32000,
2,
- config,
TempFilename(OutputPath(), "debug_aec"),
apm_config.pre_amplifier.enabled) {
apm_->ApplyConfig(apm_config);
@@ -290,8 +285,7 @@
}
TEST_F(DebugDumpTest, SimpleCase) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -299,8 +293,7 @@
}
TEST_F(DebugDumpTest, ChangeInputFormat) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
@@ -317,8 +310,7 @@
}
TEST_F(DebugDumpTest, ChangeReverseFormat) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
generator.SetReverseRate(48000);
@@ -329,8 +321,7 @@
}
TEST_F(DebugDumpTest, ChangeOutputFormat) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
generator.SetOutputRate(48000);
@@ -341,10 +332,9 @@
}
TEST_F(DebugDumpTest, ToggleAec) {
- Config config;
AudioProcessing::Config apm_config;
apm_config.echo_canceller.enabled = true;
- DebugDumpGenerator generator(config, apm_config);
+ DebugDumpGenerator generator(apm_config);
generator.StartRecording();
generator.Process(100);
@@ -357,14 +347,13 @@
}
TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
- Config config;
AudioProcessing::Config apm_config;
apm_config.echo_canceller.enabled = true;
apm_config.gain_controller1.analog_gain_controller.enabled = true;
apm_config.gain_controller1.analog_gain_controller.startup_min_volume = 0;
// Arbitrarily set clipping gain to 17, which will never be the default.
apm_config.gain_controller1.analog_gain_controller.clipped_level_min = 17;
- DebugDumpGenerator generator(config, apm_config);
+ DebugDumpGenerator generator(apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -388,10 +377,9 @@
}
TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
- Config config;
AudioProcessing::Config apm_config;
apm_config.echo_canceller.enabled = true;
- DebugDumpGenerator generator(config, apm_config);
+ DebugDumpGenerator generator(apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -414,10 +402,9 @@
}
TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
- Config config;
AudioProcessing::Config apm_config;
apm_config.echo_canceller.enabled = true;
- DebugDumpGenerator generator(config, apm_config);
+ DebugDumpGenerator generator(apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -439,13 +426,12 @@
}
TEST_F(DebugDumpTest, VerifyAgcClippingLevelExperimentalString) {
- Config config;
AudioProcessing::Config apm_config;
apm_config.gain_controller1.analog_gain_controller.enabled = true;
apm_config.gain_controller1.analog_gain_controller.startup_min_volume = 0;
// Arbitrarily set clipping gain to 17, which will never be the default.
apm_config.gain_controller1.analog_gain_controller.clipped_level_min = 17;
- DebugDumpGenerator generator(config, apm_config);
+ DebugDumpGenerator generator(apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -467,8 +453,7 @@
}
TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
generator.StopRecording();
@@ -495,8 +480,7 @@
#define MAYBE_ToggleAgc ToggleAgc
#endif
TEST_F(DebugDumpTest, MAYBE_ToggleAgc) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
@@ -510,8 +494,7 @@
}
TEST_F(DebugDumpTest, ToggleNs) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
generator.StartRecording();
generator.Process(100);
@@ -525,8 +508,7 @@
}
TEST_F(DebugDumpTest, TransientSuppressionOn) {
- Config config;
- DebugDumpGenerator generator(config, AudioProcessing::Config());
+ DebugDumpGenerator generator(/*apm_config=*/{});
AudioProcessing::Config apm_config = generator.apm()->GetConfig();
apm_config.transient_suppression.enabled = true;
@@ -539,10 +521,9 @@
}
TEST_F(DebugDumpTest, PreAmplifierIsOn) {
- Config config;
AudioProcessing::Config apm_config;
apm_config.pre_amplifier.enabled = true;
- DebugDumpGenerator generator(config, apm_config);
+ DebugDumpGenerator generator(apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();