Render-side pre-processing in APM.
This CL adds a way to insert a custom render-side pre-processor to
APM. The pre-processor operates in full-band mode before anything
else. Currently the render processing chain is (if everything is
enabled):
Network --> [Pre processing] --> [Band split] -->
[IntelligibilityEnhancer] --> [Echo canceller (read-only)] -->
[Band merge] --> Playout
Since the render pre processor and capture post processor have the
same interface, I renamed webrtc::PostProcessing into
webrtc::CustomProcessing.
The old APM factory method PostProcessing will be deprecated and
dependencies updated as part of webrtc:8665
NOTRY=True
Bug: webrtc:8665
Change-Id: Ia381cbf12e336d6587406a14d77243d931f69a31
Reviewed-on: https://webrtc-review.googlesource.com/29201
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21327}
diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h
index 3b8d2c4..4a3a30b 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -52,9 +52,12 @@
class HighPassFilter;
class LevelEstimator;
class NoiseSuppression;
-class PostProcessing;
+class CustomProcessing;
class VoiceDetection;
+// webrtc:8665, addedd temporarily to avoid breaking dependencies.
+typedef CustomProcessing PostProcessing;
+
// Use to enable the extended filter mode in the AEC, along with robustness
// measures around the reported system delays. It comes with a significant
// increase in AEC complexity, but is much more robust to unreliable reported
@@ -317,14 +320,24 @@
static AudioProcessing* Create();
// Allows passing in an optional configuration at create-time.
static AudioProcessing* Create(const webrtc::Config& config);
- // Deprecated. Use the Create below, with nullptr PostProcessing.
+ // Deprecated. Use the Create below, with nullptr CustomProcessing.
RTC_DEPRECATED
static AudioProcessing* Create(const webrtc::Config& config,
NonlinearBeamformer* beamformer);
+
+ // Will be deprecated and removed as part of webrtc:8665. Use the
+ // Create below, with nullptr CustomProcessing.
+ static AudioProcessing* Create(
+ const webrtc::Config& config,
+ std::unique_ptr<CustomProcessing> capture_post_processor,
+ std::unique_ptr<EchoControlFactory> echo_control_factory,
+ NonlinearBeamformer* beamformer);
+
// Allows passing in optional user-defined processing modules.
static AudioProcessing* Create(
const webrtc::Config& config,
- std::unique_ptr<PostProcessing> capture_post_processor,
+ std::unique_ptr<CustomProcessing> capture_post_processor,
+ std::unique_ptr<CustomProcessing> render_pre_processor,
std::unique_ptr<EchoControlFactory> echo_control_factory,
NonlinearBeamformer* beamformer);
~AudioProcessing() override {}
@@ -1087,8 +1100,8 @@
virtual ~NoiseSuppression() {}
};
-// Interface for a post processing submodule.
-class PostProcessing {
+// Interface for a custom processing submodule.
+class CustomProcessing {
public:
// (Re-)Initializes the submodule.
virtual void Initialize(int sample_rate_hz, int num_channels) = 0;
@@ -1097,7 +1110,7 @@
// Returns a string representation of the module state.
virtual std::string ToString() const = 0;
- virtual ~PostProcessing() {}
+ virtual ~CustomProcessing() {}
};
// The voice activity detection (VAD) component analyzes the stream to