blob: f2d30178d5e5943b1b820c7a9dbb93f4509e3b56 [file] [log] [blame]
Sam Zackrisson74ed7342018-08-16 10:54:07 +02001/*
2 * Copyright (c) 2018 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 MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_PROXY_H_
12#define MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_PROXY_H_
13
14#include "modules/audio_processing/include/audio_processing.h"
15#include "rtc_base/constructormagic.h"
16#include "rtc_base/scoped_ref_ptr.h"
17
18namespace webrtc {
19
20// Class for temporarily redirecting AEC2 configuration to a new API.
21class EchoCancellationProxy : public EchoCancellation {
22 public:
23 EchoCancellationProxy(AudioProcessing* audio_processing,
24 EchoCancellation* echo_cancellation);
25 ~EchoCancellationProxy() override;
26
27 int Enable(bool enable) override;
28 bool is_enabled() const override;
29 int enable_drift_compensation(bool enable) override;
30 bool is_drift_compensation_enabled() const override;
31 void set_stream_drift_samples(int drift) override;
32 int stream_drift_samples() const override;
33 int set_suppression_level(SuppressionLevel level) override;
34 SuppressionLevel suppression_level() const override;
35 bool stream_has_echo() const override;
36 int enable_metrics(bool enable) override;
37 bool are_metrics_enabled() const override;
38 int GetMetrics(Metrics* metrics) override;
39 int enable_delay_logging(bool enable) override;
40 bool is_delay_logging_enabled() const override;
41 int GetDelayMetrics(int* median, int* std) override;
42 int GetDelayMetrics(int* median,
43 int* std,
44 float* fraction_poor_delays) override;
45 struct AecCore* aec_core() const override;
46
47 private:
48 AudioProcessing* audio_processing_;
49 EchoCancellation* echo_cancellation_;
50
51 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCancellationProxy);
52};
53} // namespace webrtc
54
55#endif // MODULES_AUDIO_PROCESSING_ECHO_CANCELLATION_PROXY_H_