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_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
index 5ab32ec..d171715 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.h
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h
@@ -17,6 +17,7 @@
#include <vector>
#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/function_view.h"
#include "webrtc/base/gtest_prod_util.h"
#include "webrtc/base/ignore_wundef.h"
#include "webrtc/base/swap_queue.h"
@@ -126,11 +127,16 @@
EchoCancellation* echo_cancellation() const override;
EchoControlMobile* echo_control_mobile() const override;
GainControl* gain_control() const override;
+ // TODO(peah): Deprecate this API call.
HighPassFilter* high_pass_filter() const override;
LevelEstimator* level_estimator() const override;
NoiseSuppression* noise_suppression() const override;
VoiceDetection* voice_detection() const override;
+ // TODO(peah): Remove these two methods once the new API allows that.
+ void MutateConfig(rtc::FunctionView<void(AudioProcessing::Config*)> mutator);
+ AudioProcessing::Config GetConfig() const;
+
protected:
// Overridden in a mock.
virtual int InitializeLocked()
@@ -145,11 +151,14 @@
struct ApmPublicSubmodules;
struct ApmPrivateSubmodules;
+ // Submodule interface implementations.
+ std::unique_ptr<HighPassFilter> high_pass_filter_impl_;
+
class ApmSubmoduleStates {
public:
ApmSubmoduleStates();
// Updates the submodule state and returns true if it has changed.
- bool Update(bool high_pass_filter_enabled,
+ bool Update(bool low_cut_filter_enabled,
bool echo_canceller_enabled,
bool mobile_echo_controller_enabled,
bool residual_echo_detector_enabled,
@@ -167,7 +176,7 @@
bool RenderMultiBandProcessingActive() const;
private:
- bool high_pass_filter_enabled_ = false;
+ bool low_cut_filter_enabled_ = false;
bool echo_canceller_enabled_ = false;
bool mobile_echo_controller_enabled_ = false;
bool residual_echo_detector_enabled_ = false;
@@ -240,6 +249,7 @@
void InitializeLevelController() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeResidualEchoDetector()
EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
+ void InitializeLowCutFilter() EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void EmptyQueuedRenderAudio();
void AllocateRenderQueue()