This CL introduces the new functionality for setting
the APM parameters to the high-pass filter.
The introduction will be done in three steps:
1) This CL which introduces the new scheme and
changes the code in webrtcvoiceengine.cc to use it.
2) Introduce the scheme into upstream code.
3) Remove the HighPassFilter interface in APM.
BUG=webrtc::6220, webrtc::6296, webrtc::6297, webrtc::6181, webrtc::5298
Review-Url: https://codereview.webrtc.org/2415403002
Cr-Commit-Position: refs/heads/master@{#15197}
diff --git a/webrtc/modules/audio_processing/audio_processing_unittest.cc b/webrtc/modules/audio_processing/audio_processing_unittest.cc
index 139aa9d..c5f01f9 100644
--- a/webrtc/modules/audio_processing/audio_processing_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_unittest.cc
@@ -185,7 +185,10 @@
EXPECT_NOERR(ap->gain_control()->Enable(true));
#endif
- EXPECT_NOERR(ap->high_pass_filter()->Enable(true));
+ AudioProcessing::Config apm_config;
+ apm_config.high_pass_filter.enabled = true;
+ ap->ApplyConfig(apm_config);
+
EXPECT_NOERR(ap->level_estimator()->Enable(true));
EXPECT_NOERR(ap->noise_suppression()->Enable(true));
@@ -1391,10 +1394,11 @@
TEST_F(ApmTest, HighPassFilter) {
// Turn HP filter on/off
- EXPECT_EQ(apm_->kNoError, apm_->high_pass_filter()->Enable(true));
- EXPECT_TRUE(apm_->high_pass_filter()->is_enabled());
- EXPECT_EQ(apm_->kNoError, apm_->high_pass_filter()->Enable(false));
- EXPECT_FALSE(apm_->high_pass_filter()->is_enabled());
+ AudioProcessing::Config apm_config;
+ apm_config.high_pass_filter.enabled = true;
+ apm_->ApplyConfig(apm_config);
+ apm_config.high_pass_filter.enabled = false;
+ apm_->ApplyConfig(apm_config);
}
TEST_F(ApmTest, LevelEstimator) {