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_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H
12#define WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H
13
14#include "webrtc/voice_engine/include/voe_audio_processing.h"
15
16#include "webrtc/voice_engine/shared_data.h"
17
18namespace webrtc {
19
20class VoEAudioProcessingImpl : public VoEAudioProcessing {
21 public:
22  int SetNsStatus(bool enable, NsModes mode = kNsUnchanged) override;
23
24  int GetNsStatus(bool& enabled, NsModes& mode) override;
25
26  int SetAgcStatus(bool enable, AgcModes mode = kAgcUnchanged) override;
27
28  int GetAgcStatus(bool& enabled, AgcModes& mode) override;
29
30  int SetAgcConfig(AgcConfig config) override;
31
32  int GetAgcConfig(AgcConfig& config) override;
33
34  int SetRxNsStatus(int channel,
35                    bool enable,
36                    NsModes mode = kNsUnchanged) override;
37
38  int GetRxNsStatus(int channel, bool& enabled, NsModes& mode) override;
39
40  int SetRxAgcStatus(int channel,
41                     bool enable,
42                     AgcModes mode = kAgcUnchanged) override;
43
44  int GetRxAgcStatus(int channel, bool& enabled, AgcModes& mode) override;
45
46  int SetRxAgcConfig(int channel, AgcConfig config) override;
47
48  int GetRxAgcConfig(int channel, AgcConfig& config) override;
49
50  int SetEcStatus(bool enable, EcModes mode = kEcUnchanged) override;
51  int GetEcStatus(bool& enabled, EcModes& mode) override;
52  int EnableDriftCompensation(bool enable) override;
53  bool DriftCompensationEnabled() override;
54
55  void SetDelayOffsetMs(int offset) override;
56  int DelayOffsetMs() override;
57
58  int SetAecmMode(AecmModes mode = kAecmSpeakerphone,
59                  bool enableCNG = true) override;
60
61  int GetAecmMode(AecmModes& mode, bool& enabledCNG) override;
62
63  int EnableHighPassFilter(bool enable) override;
64  bool IsHighPassFilterEnabled() override;
65
66  int RegisterRxVadObserver(int channel, VoERxVadCallback& observer) override;
67
68  int DeRegisterRxVadObserver(int channel) override;
69
70  int VoiceActivityIndicator(int channel) override;
71
72  int SetEcMetricsStatus(bool enable) override;
73
74  int GetEcMetricsStatus(bool& enabled) override;
75
76  int GetEchoMetrics(int& ERL, int& ERLE, int& RERL, int& A_NLP) override;
77
78  int GetEcDelayMetrics(int& delay_median,
79                        int& delay_std,
80                        float& fraction_poor_delays) override;
81
82  int StartDebugRecording(const char* fileNameUTF8) override;
83  int StartDebugRecording(FILE* file_handle) override;
84
85  int StopDebugRecording() override;
86
87  int SetTypingDetectionStatus(bool enable) override;
88
89  int GetTypingDetectionStatus(bool& enabled) override;
90
91  int TimeSinceLastTyping(int& seconds) override;
92
93  // TODO(niklase) Remove default argument as soon as libJingle is updated!
94  int SetTypingDetectionParameters(int timeWindow,
95                                   int costPerTyping,
96                                   int reportingThreshold,
97                                   int penaltyDecay,
98                                   int typeEventDelay = 0) override;
99
100  void EnableStereoChannelSwapping(bool enable) override;
101  bool IsStereoChannelSwappingEnabled() override;
102
103 protected:
104  VoEAudioProcessingImpl(voe::SharedData* shared);
105  ~VoEAudioProcessingImpl() override;
106
107 private:
108  bool _isAecMode;
109  voe::SharedData* _shared;
110};
111
112}  // namespace webrtc
113
114#endif  // WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H
115