andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 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 | |
| 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |
| 13 | |
andrew@webrtc.org | 25613ea | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 14 | #include "webrtc/modules/audio_processing/echo_cancellation_impl_wrapper.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 15 | |
| 16 | namespace webrtc { |
andrew@webrtc.org | 25613ea | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 17 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 18 | class AudioProcessingImpl; |
| 19 | class AudioBuffer; |
| 20 | |
andrew@webrtc.org | 25613ea | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 21 | class EchoCancellationImpl : public EchoCancellationImplWrapper { |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 22 | public: |
| 23 | explicit EchoCancellationImpl(const AudioProcessingImpl* apm); |
| 24 | virtual ~EchoCancellationImpl(); |
| 25 | |
andrew@webrtc.org | 25613ea | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 26 | // EchoCancellationImplWrapper implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 27 | virtual int ProcessRenderAudio(const AudioBuffer* audio) OVERRIDE; |
| 28 | virtual int ProcessCaptureAudio(AudioBuffer* audio) OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 29 | |
| 30 | // EchoCancellation implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 31 | virtual bool is_enabled() const OVERRIDE; |
| 32 | virtual int device_sample_rate_hz() const OVERRIDE; |
| 33 | virtual int stream_drift_samples() const OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 34 | |
| 35 | // ProcessingComponent implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 36 | virtual int Initialize() OVERRIDE; |
andrew@webrtc.org | 8ddec2c | 2013-09-25 23:17:38 +0000 | [diff] [blame] | 37 | virtual void SetExtraOptions(const Config& config) OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 38 | |
| 39 | private: |
| 40 | // EchoCancellation implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 41 | virtual int Enable(bool enable) OVERRIDE; |
| 42 | virtual int enable_drift_compensation(bool enable) OVERRIDE; |
| 43 | virtual bool is_drift_compensation_enabled() const OVERRIDE; |
| 44 | virtual int set_device_sample_rate_hz(int rate) OVERRIDE; |
| 45 | virtual void set_stream_drift_samples(int drift) OVERRIDE; |
| 46 | virtual int set_suppression_level(SuppressionLevel level) OVERRIDE; |
| 47 | virtual SuppressionLevel suppression_level() const OVERRIDE; |
| 48 | virtual int enable_metrics(bool enable) OVERRIDE; |
| 49 | virtual bool are_metrics_enabled() const OVERRIDE; |
| 50 | virtual bool stream_has_echo() const OVERRIDE; |
| 51 | virtual int GetMetrics(Metrics* metrics) OVERRIDE; |
| 52 | virtual int enable_delay_logging(bool enable) OVERRIDE; |
| 53 | virtual bool is_delay_logging_enabled() const OVERRIDE; |
| 54 | virtual int GetDelayMetrics(int* median, int* std) OVERRIDE; |
| 55 | virtual struct AecCore* aec_core() const OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 56 | |
| 57 | // ProcessingComponent implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 58 | virtual void* CreateHandle() const OVERRIDE; |
| 59 | virtual int InitializeHandle(void* handle) const OVERRIDE; |
| 60 | virtual int ConfigureHandle(void* handle) const OVERRIDE; |
| 61 | virtual int DestroyHandle(void* handle) const OVERRIDE; |
| 62 | virtual int num_handles_required() const OVERRIDE; |
| 63 | virtual int GetHandleError(void* handle) const OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 64 | |
| 65 | const AudioProcessingImpl* apm_; |
| 66 | bool drift_compensation_enabled_; |
| 67 | bool metrics_enabled_; |
| 68 | SuppressionLevel suppression_level_; |
| 69 | int device_sample_rate_hz_; |
| 70 | int stream_drift_samples_; |
| 71 | bool was_stream_drift_set_; |
| 72 | bool stream_has_echo_; |
| 73 | bool delay_logging_enabled_; |
andrew@webrtc.org | 8ddec2c | 2013-09-25 23:17:38 +0000 | [diff] [blame] | 74 | bool delay_correction_enabled_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 75 | }; |
andrew@webrtc.org | 25613ea | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 76 | |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 77 | } // namespace webrtc |
| 78 | |
| 79 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_ |