niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
bjornv@webrtc.org | 91d11b3 | 2013-03-05 16:53:09 +0000 | [diff] [blame^] | 14 | #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 15 | #include "webrtc/modules/audio_processing/processing_component.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | class AudioProcessingImpl; |
| 19 | class AudioBuffer; |
| 20 | |
| 21 | class EchoCancellationImpl : public EchoCancellation, |
| 22 | public ProcessingComponent { |
| 23 | public: |
| 24 | explicit EchoCancellationImpl(const AudioProcessingImpl* apm); |
| 25 | virtual ~EchoCancellationImpl(); |
| 26 | |
| 27 | int ProcessRenderAudio(const AudioBuffer* audio); |
| 28 | int ProcessCaptureAudio(AudioBuffer* audio); |
| 29 | |
| 30 | // EchoCancellation implementation. |
| 31 | virtual bool is_enabled() const; |
ajm@google.com | 808e0e0 | 2011-08-03 21:08:51 +0000 | [diff] [blame] | 32 | virtual int device_sample_rate_hz() const; |
| 33 | virtual int stream_drift_samples() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | |
| 35 | // ProcessingComponent implementation. |
| 36 | virtual int Initialize(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | |
| 38 | private: |
| 39 | // EchoCancellation implementation. |
| 40 | virtual int Enable(bool enable); |
| 41 | virtual int enable_drift_compensation(bool enable); |
| 42 | virtual bool is_drift_compensation_enabled() const; |
| 43 | virtual int set_device_sample_rate_hz(int rate); |
andrew@webrtc.org | 6be1e93 | 2013-03-01 18:47:28 +0000 | [diff] [blame] | 44 | virtual void set_stream_drift_samples(int drift); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 45 | virtual int set_suppression_level(SuppressionLevel level); |
| 46 | virtual SuppressionLevel suppression_level() const; |
| 47 | virtual int enable_metrics(bool enable); |
| 48 | virtual bool are_metrics_enabled() const; |
| 49 | virtual bool stream_has_echo() const; |
| 50 | virtual int GetMetrics(Metrics* metrics); |
bjornv@google.com | 1ba3dbe | 2011-10-03 08:18:10 +0000 | [diff] [blame] | 51 | virtual int enable_delay_logging(bool enable); |
| 52 | virtual bool is_delay_logging_enabled() const; |
| 53 | virtual int GetDelayMetrics(int* median, int* std); |
bjornv@webrtc.org | 91d11b3 | 2013-03-05 16:53:09 +0000 | [diff] [blame^] | 54 | virtual struct AecCore* aec_core() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 55 | |
| 56 | // ProcessingComponent implementation. |
| 57 | virtual void* CreateHandle() const; |
| 58 | virtual int InitializeHandle(void* handle) const; |
| 59 | virtual int ConfigureHandle(void* handle) const; |
| 60 | virtual int DestroyHandle(void* handle) const; |
| 61 | virtual int num_handles_required() const; |
| 62 | virtual int GetHandleError(void* handle) const; |
| 63 | |
| 64 | const AudioProcessingImpl* apm_; |
| 65 | bool drift_compensation_enabled_; |
| 66 | bool metrics_enabled_; |
| 67 | SuppressionLevel suppression_level_; |
| 68 | int device_sample_rate_hz_; |
| 69 | int stream_drift_samples_; |
| 70 | bool was_stream_drift_set_; |
| 71 | bool stream_has_echo_; |
bjornv@google.com | 1ba3dbe | 2011-10-03 08:18:10 +0000 | [diff] [blame] | 72 | bool delay_logging_enabled_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 73 | }; |
| 74 | } // namespace webrtc |
| 75 | |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 76 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |