blob: 07506d4e03d8d072d7121c453b6f22e3e358097c [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
bjornv@webrtc.org0c6f9312012-01-30 09:39:08 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.org0c6f9312012-01-30 09:39:08 +000011#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_
12#define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
andrew@webrtc.org61e596f2013-07-25 18:28:29 +000014#include "webrtc/modules/audio_processing/echo_cancellation_impl_wrapper.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015
16namespace webrtc {
andrew@webrtc.org61e596f2013-07-25 18:28:29 +000017
niklase@google.com470e71d2011-07-07 08:21:25 +000018class AudioProcessingImpl;
19class AudioBuffer;
20
andrew@webrtc.org61e596f2013-07-25 18:28:29 +000021class EchoCancellationImpl : public EchoCancellationImplWrapper {
niklase@google.com470e71d2011-07-07 08:21:25 +000022 public:
23 explicit EchoCancellationImpl(const AudioProcessingImpl* apm);
24 virtual ~EchoCancellationImpl();
25
andrew@webrtc.org61e596f2013-07-25 18:28:29 +000026 // EchoCancellationImplWrapper implementation.
pbos@webrtc.org91620802013-08-02 11:44:11 +000027 virtual int ProcessRenderAudio(const AudioBuffer* audio) OVERRIDE;
28 virtual int ProcessCaptureAudio(AudioBuffer* audio) OVERRIDE;
niklase@google.com470e71d2011-07-07 08:21:25 +000029
30 // EchoCancellation implementation.
pbos@webrtc.org91620802013-08-02 11:44:11 +000031 virtual bool is_enabled() const OVERRIDE;
32 virtual int device_sample_rate_hz() const OVERRIDE;
33 virtual int stream_drift_samples() const OVERRIDE;
niklase@google.com470e71d2011-07-07 08:21:25 +000034
35 // ProcessingComponent implementation.
pbos@webrtc.org91620802013-08-02 11:44:11 +000036 virtual int Initialize() OVERRIDE;
niklase@google.com470e71d2011-07-07 08:21:25 +000037
38 private:
39 // EchoCancellation implementation.
pbos@webrtc.org91620802013-08-02 11:44:11 +000040 virtual int Enable(bool enable) OVERRIDE;
41 virtual int enable_drift_compensation(bool enable) OVERRIDE;
42 virtual bool is_drift_compensation_enabled() const OVERRIDE;
43 virtual int set_device_sample_rate_hz(int rate) OVERRIDE;
44 virtual void set_stream_drift_samples(int drift) OVERRIDE;
45 virtual int set_suppression_level(SuppressionLevel level) OVERRIDE;
46 virtual SuppressionLevel suppression_level() const OVERRIDE;
47 virtual int enable_metrics(bool enable) OVERRIDE;
48 virtual bool are_metrics_enabled() const OVERRIDE;
49 virtual bool stream_has_echo() const OVERRIDE;
50 virtual int GetMetrics(Metrics* metrics) OVERRIDE;
51 virtual int enable_delay_logging(bool enable) OVERRIDE;
52 virtual bool is_delay_logging_enabled() const OVERRIDE;
53 virtual int GetDelayMetrics(int* median, int* std) OVERRIDE;
54 virtual struct AecCore* aec_core() const OVERRIDE;
niklase@google.com470e71d2011-07-07 08:21:25 +000055
56 // ProcessingComponent implementation.
pbos@webrtc.org91620802013-08-02 11:44:11 +000057 virtual void* CreateHandle() const OVERRIDE;
58 virtual int InitializeHandle(void* handle) const OVERRIDE;
59 virtual int ConfigureHandle(void* handle) const OVERRIDE;
60 virtual int DestroyHandle(void* handle) const OVERRIDE;
61 virtual int num_handles_required() const OVERRIDE;
62 virtual int GetHandleError(void* handle) const OVERRIDE;
niklase@google.com470e71d2011-07-07 08:21:25 +000063
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.com1ba3dbe2011-10-03 08:18:10 +000072 bool delay_logging_enabled_;
niklase@google.com470e71d2011-07-07 08:21:25 +000073};
andrew@webrtc.org61e596f2013-07-25 18:28:29 +000074
niklase@google.com470e71d2011-07-07 08:21:25 +000075} // namespace webrtc
76
bjornv@webrtc.org0c6f9312012-01-30 09:39:08 +000077#endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_