2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-01-30 09:39:08 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2012-01-30 09:39:08 +00:00
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-02-27 22:23:17 +00:00
|
|
|
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
|
|
|
|
#include "webrtc/modules/audio_processing/processing_component.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2013-07-25 18:28:29 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
class AudioBuffer;
|
2014-02-27 22:23:17 +00:00
|
|
|
class CriticalSectionWrapper;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-02-27 22:23:17 +00:00
|
|
|
class EchoCancellationImpl : public EchoCancellation,
|
|
|
|
|
public ProcessingComponent {
|
2011-07-07 08:21:25 +00:00
|
|
|
public:
|
2014-02-27 22:23:17 +00:00
|
|
|
EchoCancellationImpl(const AudioProcessing* apm,
|
|
|
|
|
CriticalSectionWrapper* crit);
|
2011-07-07 08:21:25 +00:00
|
|
|
virtual ~EchoCancellationImpl();
|
|
|
|
|
|
2014-02-27 22:23:17 +00:00
|
|
|
int ProcessRenderAudio(const AudioBuffer* audio);
|
|
|
|
|
int ProcessCaptureAudio(AudioBuffer* audio);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// EchoCancellation implementation.
|
2013-08-02 11:44:11 +00:00
|
|
|
virtual bool is_enabled() const OVERRIDE;
|
|
|
|
|
virtual int stream_drift_samples() const OVERRIDE;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// ProcessingComponent implementation.
|
2013-08-02 11:44:11 +00:00
|
|
|
virtual int Initialize() OVERRIDE;
|
2013-09-25 23:17:38 +00:00
|
|
|
virtual void SetExtraOptions(const Config& config) OVERRIDE;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// EchoCancellation implementation.
|
2013-08-02 11:44:11 +00:00
|
|
|
virtual int Enable(bool enable) OVERRIDE;
|
|
|
|
|
virtual int enable_drift_compensation(bool enable) OVERRIDE;
|
|
|
|
|
virtual bool is_drift_compensation_enabled() const OVERRIDE;
|
|
|
|
|
virtual void set_stream_drift_samples(int drift) OVERRIDE;
|
|
|
|
|
virtual int set_suppression_level(SuppressionLevel level) OVERRIDE;
|
|
|
|
|
virtual SuppressionLevel suppression_level() const OVERRIDE;
|
|
|
|
|
virtual int enable_metrics(bool enable) OVERRIDE;
|
|
|
|
|
virtual bool are_metrics_enabled() const OVERRIDE;
|
|
|
|
|
virtual bool stream_has_echo() const OVERRIDE;
|
|
|
|
|
virtual int GetMetrics(Metrics* metrics) OVERRIDE;
|
|
|
|
|
virtual int enable_delay_logging(bool enable) OVERRIDE;
|
|
|
|
|
virtual bool is_delay_logging_enabled() const OVERRIDE;
|
|
|
|
|
virtual int GetDelayMetrics(int* median, int* std) OVERRIDE;
|
|
|
|
|
virtual struct AecCore* aec_core() const OVERRIDE;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// ProcessingComponent implementation.
|
2013-08-02 11:44:11 +00:00
|
|
|
virtual void* CreateHandle() const OVERRIDE;
|
|
|
|
|
virtual int InitializeHandle(void* handle) const OVERRIDE;
|
|
|
|
|
virtual int ConfigureHandle(void* handle) const OVERRIDE;
|
2014-04-22 06:52:28 +00:00
|
|
|
virtual void DestroyHandle(void* handle) const OVERRIDE;
|
2013-08-02 11:44:11 +00:00
|
|
|
virtual int num_handles_required() const OVERRIDE;
|
|
|
|
|
virtual int GetHandleError(void* handle) const OVERRIDE;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-02-27 22:23:17 +00:00
|
|
|
const AudioProcessing* apm_;
|
|
|
|
|
CriticalSectionWrapper* crit_;
|
2011-07-07 08:21:25 +00:00
|
|
|
bool drift_compensation_enabled_;
|
|
|
|
|
bool metrics_enabled_;
|
|
|
|
|
SuppressionLevel suppression_level_;
|
|
|
|
|
int stream_drift_samples_;
|
|
|
|
|
bool was_stream_drift_set_;
|
|
|
|
|
bool stream_has_echo_;
|
2011-10-03 08:18:10 +00:00
|
|
|
bool delay_logging_enabled_;
|
2013-09-25 23:17:38 +00:00
|
|
|
bool delay_correction_enabled_;
|
2014-04-23 13:20:07 +00:00
|
|
|
bool reported_delay_enabled_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2013-07-25 18:28:29 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2012-01-30 09:39:08 +00:00
|
|
|
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_IMPL_H_
|