Toggle AECs via AudioProcessing::Config
This allows clients to stop using the old pointer-to-submodule interfaces
for enabling/disabling AEC2 and AECM.
The legacy suppression level flag for AEC2 is not yet activated.
NoTry=TRUE
Bug: webrtc:9535
Change-Id: Ie2c3378d832a6b393aec656d96597f85e299f500
Reviewed-on: https://webrtc-review.googlesource.com/94771
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24328}
diff --git a/modules/audio_processing/audio_processing_unittest.cc b/modules/audio_processing/audio_processing_unittest.cc
index 346c2a2..198c66d 100644
--- a/modules/audio_processing/audio_processing_unittest.cc
+++ b/modules/audio_processing/audio_processing_unittest.cc
@@ -178,25 +178,26 @@
}
void EnableAllAPComponents(AudioProcessing* ap) {
+ AudioProcessing::Config apm_config = ap->GetConfig();
+ apm_config.echo_canceller.enabled = true;
#if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)
- EXPECT_NOERR(ap->echo_control_mobile()->Enable(true));
+ apm_config.echo_canceller.mobile_mode = true;
EXPECT_NOERR(ap->gain_control()->set_mode(GainControl::kAdaptiveDigital));
EXPECT_NOERR(ap->gain_control()->Enable(true));
#elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE)
+ apm_config.echo_canceller.mobile_mode = false;
EXPECT_NOERR(ap->echo_cancellation()->enable_drift_compensation(true));
EXPECT_NOERR(ap->echo_cancellation()->enable_metrics(true));
EXPECT_NOERR(ap->echo_cancellation()->enable_delay_logging(true));
EXPECT_NOERR(ap->echo_cancellation()->set_suppression_level(
EchoCancellation::SuppressionLevel::kModerateSuppression));
- EXPECT_NOERR(ap->echo_cancellation()->Enable(true));
EXPECT_NOERR(ap->gain_control()->set_mode(GainControl::kAdaptiveAnalog));
EXPECT_NOERR(ap->gain_control()->set_analog_level_limits(0, 255));
EXPECT_NOERR(ap->gain_control()->Enable(true));
#endif
- AudioProcessing::Config apm_config;
apm_config.high_pass_filter.enabled = true;
ap->ApplyConfig(apm_config);