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}
This commit is contained in:
Sam Zackrisson
2018-08-17 16:26:14 +02:00
committed by Commit Bot
parent 3229d65fd0
commit b3b47ad7e6
4 changed files with 21 additions and 13 deletions

View File

@ -178,25 +178,26 @@ bool FrameDataAreEqual(const AudioFrame& frame1, const AudioFrame& frame2) {
}
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);