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/include/audio_processing.h b/webrtc/modules/audio_processing/include/audio_processing.h
index 2c0f554..d3ae3e8 100644
--- a/webrtc/modules/audio_processing/include/audio_processing.h
+++ b/webrtc/modules/audio_processing/include/audio_processing.h
@@ -199,10 +199,9 @@
//
// AudioProcessing::Config config;
// config.level_controller.enabled = true;
+// config.high_pass_filter.enabled = true;
// apm->ApplyConfig(config)
//
-// apm->high_pass_filter()->Enable(true);
-//
// apm->echo_cancellation()->enable_drift_compensation(false);
// apm->echo_cancellation()->Enable(true);
//
@@ -265,6 +264,10 @@
bool enabled = true;
#endif
} residual_echo_detector;
+
+ struct HighPassFilter {
+ bool enabled = false;
+ } high_pass_filter;
};
// TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone.
@@ -554,6 +557,7 @@
virtual EchoCancellation* echo_cancellation() const = 0;
virtual EchoControlMobile* echo_control_mobile() const = 0;
virtual GainControl* gain_control() const = 0;
+ // TODO(peah): Deprecate this API call.
virtual HighPassFilter* high_pass_filter() const = 0;
virtual LevelEstimator* level_estimator() const = 0;
virtual NoiseSuppression* noise_suppression() const = 0;
@@ -960,7 +964,7 @@
protected:
virtual ~GainControl() {}
};
-
+// TODO(peah): Remove this interface.
// A filtering component which removes DC offset and low-frequency noise.
// Recommended to be enabled on the client-side.
class HighPassFilter {
@@ -968,7 +972,6 @@
virtual int Enable(bool enable) = 0;
virtual bool is_enabled() const = 0;
- protected:
virtual ~HighPassFilter() {}
};