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_CONTROL_MOBILE_IMPL_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |
| 13 | |
pbos@webrtc.org | 9fb1613 | 2013-05-28 08:11:59 +0000 | [diff] [blame] | 14 | #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 15 | #include "webrtc/modules/audio_processing/processing_component.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | class AudioProcessingImpl; |
| 19 | class AudioBuffer; |
| 20 | |
| 21 | class EchoControlMobileImpl : public EchoControlMobile, |
| 22 | public ProcessingComponent { |
| 23 | public: |
| 24 | explicit EchoControlMobileImpl(const AudioProcessingImpl* apm); |
| 25 | virtual ~EchoControlMobileImpl(); |
| 26 | |
| 27 | int ProcessRenderAudio(const AudioBuffer* audio); |
| 28 | int ProcessCaptureAudio(AudioBuffer* audio); |
| 29 | |
| 30 | // EchoControlMobile implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 31 | virtual bool is_enabled() const OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 32 | |
| 33 | // ProcessingComponent implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 34 | virtual int Initialize() OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 35 | |
| 36 | private: |
| 37 | // EchoControlMobile implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 38 | virtual int Enable(bool enable) OVERRIDE; |
| 39 | virtual int set_routing_mode(RoutingMode mode) OVERRIDE; |
| 40 | virtual RoutingMode routing_mode() const OVERRIDE; |
| 41 | virtual int enable_comfort_noise(bool enable) OVERRIDE; |
| 42 | virtual bool is_comfort_noise_enabled() const OVERRIDE; |
| 43 | virtual int SetEchoPath(const void* echo_path, size_t size_bytes) OVERRIDE; |
| 44 | virtual int GetEchoPath(void* echo_path, size_t size_bytes) const OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 45 | |
| 46 | // ProcessingComponent implementation. |
pbos@webrtc.org | 24add92 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 47 | virtual void* CreateHandle() const OVERRIDE; |
| 48 | virtual int InitializeHandle(void* handle) const OVERRIDE; |
| 49 | virtual int ConfigureHandle(void* handle) const OVERRIDE; |
| 50 | virtual int DestroyHandle(void* handle) const OVERRIDE; |
| 51 | virtual int num_handles_required() const OVERRIDE; |
| 52 | virtual int GetHandleError(void* handle) const OVERRIDE; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 53 | |
| 54 | const AudioProcessingImpl* apm_; |
| 55 | RoutingMode routing_mode_; |
| 56 | bool comfort_noise_enabled_; |
| 57 | unsigned char* external_echo_path_; |
| 58 | }; |
| 59 | } // namespace webrtc |
| 60 | |
| 61 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CONTROL_MOBILE_IMPL_H_ |