blob: 524439d5c137240aa5a70df1adf028d06bfa0a57 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.org6f9f8172012-03-06 19:03:39 +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
11#ifndef WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H
12#define WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H
13
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000014#include "webrtc/voice_engine/include/voe_audio_processing.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000016#include "webrtc/voice_engine/shared_data.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017
niklase@google.com470e71d2011-07-07 08:21:25 +000018namespace webrtc {
19
tommi@webrtc.orga990e122012-04-26 15:28:22 +000020class VoEAudioProcessingImpl : public VoEAudioProcessing {
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000021 public:
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000022 virtual int SetNsStatus(bool enable, NsModes mode = kNsUnchanged);
niklase@google.com470e71d2011-07-07 08:21:25 +000023
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000024 virtual int GetNsStatus(bool& enabled, NsModes& mode);
niklase@google.com470e71d2011-07-07 08:21:25 +000025
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000026 virtual int SetAgcStatus(bool enable, AgcModes mode = kAgcUnchanged);
niklase@google.com470e71d2011-07-07 08:21:25 +000027
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000028 virtual int GetAgcStatus(bool& enabled, AgcModes& mode);
niklase@google.com470e71d2011-07-07 08:21:25 +000029
pbos@webrtc.org92135212013-05-14 08:31:39 +000030 virtual int SetAgcConfig(AgcConfig config);
niklase@google.com470e71d2011-07-07 08:21:25 +000031
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000032 virtual int GetAgcConfig(AgcConfig& config);
niklase@google.com470e71d2011-07-07 08:21:25 +000033
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000034 virtual int SetRxNsStatus(int channel,
35 bool enable,
36 NsModes mode = kNsUnchanged);
niklase@google.com470e71d2011-07-07 08:21:25 +000037
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000038 virtual int GetRxNsStatus(int channel, bool& enabled, NsModes& mode);
niklase@google.com470e71d2011-07-07 08:21:25 +000039
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000040 virtual int SetRxAgcStatus(int channel,
41 bool enable,
42 AgcModes mode = kAgcUnchanged);
niklase@google.com470e71d2011-07-07 08:21:25 +000043
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000044 virtual int GetRxAgcStatus(int channel, bool& enabled, AgcModes& mode);
niklase@google.com470e71d2011-07-07 08:21:25 +000045
pbos@webrtc.org92135212013-05-14 08:31:39 +000046 virtual int SetRxAgcConfig(int channel, AgcConfig config);
niklase@google.com470e71d2011-07-07 08:21:25 +000047
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000048 virtual int GetRxAgcConfig(int channel, AgcConfig& config);
niklase@google.com470e71d2011-07-07 08:21:25 +000049
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000050 virtual int SetEcStatus(bool enable, EcModes mode = kEcUnchanged);
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000051 virtual int GetEcStatus(bool& enabled, EcModes& mode);
andrew@webrtc.org55c0d4a2012-08-29 02:13:12 +000052 virtual int EnableDriftCompensation(bool enable);
53 virtual bool DriftCompensationEnabled();
niklase@google.com470e71d2011-07-07 08:21:25 +000054
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000055 virtual void SetDelayOffsetMs(int offset);
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000056 virtual int DelayOffsetMs();
andrew@webrtc.org6f9f8172012-03-06 19:03:39 +000057
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000058 virtual int SetAecmMode(AecmModes mode = kAecmSpeakerphone,
59 bool enableCNG = true);
niklase@google.com470e71d2011-07-07 08:21:25 +000060
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000061 virtual int GetAecmMode(AecmModes& mode, bool& enabledCNG);
niklase@google.com470e71d2011-07-07 08:21:25 +000062
andrew@webrtc.org369166a2012-04-24 18:38:03 +000063 virtual int EnableHighPassFilter(bool enable);
64 virtual bool IsHighPassFilterEnabled();
65
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000066 virtual int RegisterRxVadObserver(int channel,
67 VoERxVadCallback& observer);
niklase@google.com470e71d2011-07-07 08:21:25 +000068
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000069 virtual int DeRegisterRxVadObserver(int channel);
niklase@google.com470e71d2011-07-07 08:21:25 +000070
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000071 virtual int VoiceActivityIndicator(int channel);
niklase@google.com470e71d2011-07-07 08:21:25 +000072
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000073 virtual int SetEcMetricsStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +000074
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000075 virtual int GetEcMetricsStatus(bool& enabled);
niklase@google.com470e71d2011-07-07 08:21:25 +000076
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000077 virtual int GetEchoMetrics(int& ERL, int& ERLE, int& RERL, int& A_NLP);
niklase@google.com470e71d2011-07-07 08:21:25 +000078
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000079 virtual int GetEcDelayMetrics(int& delay_median, int& delay_std);
bjornv@webrtc.org3765bd22011-10-17 08:49:23 +000080
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000081 virtual int StartDebugRecording(const char* fileNameUTF8);
henrikg@webrtc.org863b5362013-12-06 16:05:17 +000082 virtual int StartDebugRecording(FILE* file_handle);
niklase@google.com470e71d2011-07-07 08:21:25 +000083
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000084 virtual int StopDebugRecording();
niklase@google.com470e71d2011-07-07 08:21:25 +000085
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000086 virtual int SetTypingDetectionStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +000087
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +000088 virtual int GetTypingDetectionStatus(bool& enabled);
niklase@google.com470e71d2011-07-07 08:21:25 +000089
niklas.enbom@webrtc.org3dc88652012-03-30 09:53:54 +000090 virtual int TimeSinceLastTyping(int &seconds);
91
niklas.enbom@webrtc.orgee646c32012-05-24 11:41:02 +000092 // TODO(niklase) Remove default argument as soon as libJingle is updated!
niklas.enbom@webrtc.org06e722a2012-04-04 07:44:27 +000093 virtual int SetTypingDetectionParameters(int timeWindow,
94 int costPerTyping,
95 int reportingThreshold,
niklas.enbom@webrtc.orgf6edfef2012-05-09 13:16:12 +000096 int penaltyDecay,
niklas.enbom@webrtc.orgee646c32012-05-24 11:41:02 +000097 int typeEventDelay = 0);
niklas.enbom@webrtc.org06e722a2012-04-04 07:44:27 +000098
andrew@webrtc.org02d71742012-04-24 19:47:00 +000099 virtual void EnableStereoChannelSwapping(bool enable);
100 virtual bool IsStereoChannelSwappingEnabled();
101
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +0000102 protected:
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000103 VoEAudioProcessingImpl(voe::SharedData* shared);
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +0000104 virtual ~VoEAudioProcessingImpl();
niklase@google.com470e71d2011-07-07 08:21:25 +0000105
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +0000106 private:
107 bool _isAecMode;
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000108 voe::SharedData* _shared;
niklase@google.com470e71d2011-07-07 08:21:25 +0000109};
110
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000111} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000112
andrew@webrtc.org8b111eb2012-03-06 19:50:12 +0000113#endif // WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H