From 8e467dfa6d56f6e8e664e73e4483d9938fc283f6 Mon Sep 17 00:00:00 2001 From: Gustaf Ullberg Date: Mon, 5 Feb 2018 14:39:38 +0100 Subject: [PATCH] Move EchoControl out of audio_processing.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8844 Change-Id: Id05c285e0e377774c79da8552959733f823d8bb4 Reviewed-on: https://webrtc-review.googlesource.com/47900 Reviewed-by: Per Ã…hgren Commit-Queue: Gustaf Ullberg Cr-Commit-Position: refs/heads/master@{#21898} --- modules/audio_processing/BUILD.gn | 1 + .../include/audio_processing.h | 33 +----------- .../audio_processing/include/echo_control.h | 52 +++++++++++++++++++ 3 files changed, 54 insertions(+), 32 deletions(-) create mode 100644 modules/audio_processing/include/echo_control.h diff --git a/modules/audio_processing/BUILD.gn b/modules/audio_processing/BUILD.gn index f7837101c8..5aad38b754 100644 --- a/modules/audio_processing/BUILD.gn +++ b/modules/audio_processing/BUILD.gn @@ -155,6 +155,7 @@ rtc_static_library("audio_processing") { "include/audio_processing.h", "include/config.cc", "include/config.h", + "include/echo_control.h", "level_controller/biquad_filter.cc", "level_controller/biquad_filter.h", "level_controller/down_sampler.cc", diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h index 5185a1fe6f..2f4cdb50fc 100644 --- a/modules/audio_processing/include/audio_processing.h +++ b/modules/audio_processing/include/audio_processing.h @@ -26,6 +26,7 @@ #include "modules/audio_processing/beamformer/array_util.h" #include "modules/audio_processing/include/audio_processing_statistics.h" #include "modules/audio_processing/include/config.h" +#include "modules/audio_processing/include/echo_control.h" #include "rtc_base/arraysize.h" #include "rtc_base/deprecation.h" #include "rtc_base/platform_file.h" @@ -48,7 +49,6 @@ class ProcessingConfig; class EchoCancellation; class EchoControlMobile; -class EchoControlFactory; class EchoDetector; class GainControl; class HighPassFilter; @@ -913,37 +913,6 @@ class EchoControlMobile { virtual ~EchoControlMobile() {} }; -// Interface for an acoustic echo cancellation (AEC) submodule. -class EchoControl { - public: - // Analysis (not changing) of the render signal. - virtual void AnalyzeRender(AudioBuffer* render) = 0; - - // Analysis (not changing) of the capture signal. - virtual void AnalyzeCapture(AudioBuffer* capture) = 0; - - // Processes the capture signal in order to remove the echo. - virtual void ProcessCapture(AudioBuffer* capture, bool echo_path_change) = 0; - - struct Metrics { - double echo_return_loss; - double echo_return_loss_enhancement; - int delay_ms; - }; - - // Collect current metrics from the echo controller. - virtual Metrics GetMetrics() const = 0; - - virtual ~EchoControl() {} -}; - -// Interface for a factory that creates EchoControllers. -class EchoControlFactory { - public: - virtual std::unique_ptr Create(int sample_rate_hz) = 0; - virtual ~EchoControlFactory() = default; -}; - // The automatic gain control (AGC) component brings the signal to an // appropriate range. This is done by applying a digital gain directly and, in // the analog mode, prescribing an analog gain to be applied at the audio HAL. diff --git a/modules/audio_processing/include/echo_control.h b/modules/audio_processing/include/echo_control.h new file mode 100644 index 0000000000..7fe4f3bbda --- /dev/null +++ b/modules/audio_processing/include/echo_control.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef MODULES_AUDIO_PROCESSING_INCLUDE_ECHO_CONTROL_H_ +#define MODULES_AUDIO_PROCESSING_INCLUDE_ECHO_CONTROL_H_ + +#include + +namespace webrtc { + +class AudioBuffer; + +// Interface for an acoustic echo cancellation (AEC) submodule. +class EchoControl { + public: + // Analysis (not changing) of the render signal. + virtual void AnalyzeRender(AudioBuffer* render) = 0; + + // Analysis (not changing) of the capture signal. + virtual void AnalyzeCapture(AudioBuffer* capture) = 0; + + // Processes the capture signal in order to remove the echo. + virtual void ProcessCapture(AudioBuffer* capture, bool echo_path_change) = 0; + + struct Metrics { + double echo_return_loss; + double echo_return_loss_enhancement; + int delay_ms; + }; + + // Collect current metrics from the echo controller. + virtual Metrics GetMetrics() const = 0; + + virtual ~EchoControl() {} +}; + +// Interface for a factory that creates EchoControllers. +class EchoControlFactory { + public: + virtual std::unique_ptr Create(int sample_rate_hz) = 0; + virtual ~EchoControlFactory() = default; +}; +} // namespace webrtc + +#endif // MODULES_AUDIO_PROCESSING_INCLUDE_ECHO_CONTROL_H_