niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
andrew@webrtc.org | 6f9f817 | 2012-03-06 19:03:39 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 "voe_audio_processing.h" |
| 15 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | #include "shared_data.h" |
| 17 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 18 | namespace webrtc { |
| 19 | |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 20 | class VoEAudioProcessingImpl : public VoEAudioProcessing { |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 21 | public: |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 22 | virtual int SetNsStatus(bool enable, NsModes mode = kNsUnchanged); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 23 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 24 | virtual int GetNsStatus(bool& enabled, NsModes& mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 26 | virtual int SetAgcStatus(bool enable, AgcModes mode = kAgcUnchanged); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 28 | virtual int GetAgcStatus(bool& enabled, AgcModes& mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame^] | 30 | virtual int SetAgcConfig(AgcConfig config); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 31 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 32 | virtual int GetAgcConfig(AgcConfig& config); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 34 | virtual int SetRxNsStatus(int channel, |
| 35 | bool enable, |
| 36 | NsModes mode = kNsUnchanged); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 38 | virtual int GetRxNsStatus(int channel, bool& enabled, NsModes& mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 39 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 40 | virtual int SetRxAgcStatus(int channel, |
| 41 | bool enable, |
| 42 | AgcModes mode = kAgcUnchanged); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 44 | virtual int GetRxAgcStatus(int channel, bool& enabled, AgcModes& mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 45 | |
pbos@webrtc.org | 9213521 | 2013-05-14 08:31:39 +0000 | [diff] [blame^] | 46 | virtual int SetRxAgcConfig(int channel, AgcConfig config); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 47 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 48 | virtual int GetRxAgcConfig(int channel, AgcConfig& config); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 49 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 50 | virtual int SetEcStatus(bool enable, EcModes mode = kEcUnchanged); |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 51 | virtual int GetEcStatus(bool& enabled, EcModes& mode); |
andrew@webrtc.org | 55c0d4a | 2012-08-29 02:13:12 +0000 | [diff] [blame] | 52 | virtual int EnableDriftCompensation(bool enable); |
| 53 | virtual bool DriftCompensationEnabled(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 55 | virtual void SetDelayOffsetMs(int offset); |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 56 | virtual int DelayOffsetMs(); |
andrew@webrtc.org | 6f9f817 | 2012-03-06 19:03:39 +0000 | [diff] [blame] | 57 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 58 | virtual int SetAecmMode(AecmModes mode = kAecmSpeakerphone, |
| 59 | bool enableCNG = true); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 60 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 61 | virtual int GetAecmMode(AecmModes& mode, bool& enabledCNG); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 62 | |
andrew@webrtc.org | 369166a | 2012-04-24 18:38:03 +0000 | [diff] [blame] | 63 | virtual int EnableHighPassFilter(bool enable); |
| 64 | virtual bool IsHighPassFilterEnabled(); |
| 65 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 66 | virtual int RegisterRxVadObserver(int channel, |
| 67 | VoERxVadCallback& observer); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 68 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 69 | virtual int DeRegisterRxVadObserver(int channel); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 70 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 71 | virtual int VoiceActivityIndicator(int channel); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 73 | virtual int SetEcMetricsStatus(bool enable); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 75 | virtual int GetEcMetricsStatus(bool& enabled); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 76 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 77 | virtual int GetEchoMetrics(int& ERL, int& ERLE, int& RERL, int& A_NLP); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 78 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 79 | virtual int GetEcDelayMetrics(int& delay_median, int& delay_std); |
bjornv@webrtc.org | 3765bd2 | 2011-10-17 08:49:23 +0000 | [diff] [blame] | 80 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 81 | virtual int StartDebugRecording(const char* fileNameUTF8); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 82 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 83 | virtual int StopDebugRecording(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 84 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 85 | virtual int SetTypingDetectionStatus(bool enable); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 86 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 87 | virtual int GetTypingDetectionStatus(bool& enabled); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 88 | |
niklas.enbom@webrtc.org | 3dc8865 | 2012-03-30 09:53:54 +0000 | [diff] [blame] | 89 | virtual int TimeSinceLastTyping(int &seconds); |
| 90 | |
niklas.enbom@webrtc.org | ee646c3 | 2012-05-24 11:41:02 +0000 | [diff] [blame] | 91 | // TODO(niklase) Remove default argument as soon as libJingle is updated! |
niklas.enbom@webrtc.org | 06e722a | 2012-04-04 07:44:27 +0000 | [diff] [blame] | 92 | virtual int SetTypingDetectionParameters(int timeWindow, |
| 93 | int costPerTyping, |
| 94 | int reportingThreshold, |
niklas.enbom@webrtc.org | f6edfef | 2012-05-09 13:16:12 +0000 | [diff] [blame] | 95 | int penaltyDecay, |
niklas.enbom@webrtc.org | ee646c3 | 2012-05-24 11:41:02 +0000 | [diff] [blame] | 96 | int typeEventDelay = 0); |
niklas.enbom@webrtc.org | 06e722a | 2012-04-04 07:44:27 +0000 | [diff] [blame] | 97 | |
andrew@webrtc.org | 02d7174 | 2012-04-24 19:47:00 +0000 | [diff] [blame] | 98 | virtual void EnableStereoChannelSwapping(bool enable); |
| 99 | virtual bool IsStereoChannelSwappingEnabled(); |
| 100 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 101 | protected: |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 102 | VoEAudioProcessingImpl(voe::SharedData* shared); |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 103 | virtual ~VoEAudioProcessingImpl(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 104 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 105 | private: |
| 106 | bool _isAecMode; |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 107 | voe::SharedData* _shared; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 108 | }; |
| 109 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 110 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 111 | |
andrew@webrtc.org | 8b111eb | 2012-03-06 19:50:12 +0000 | [diff] [blame] | 112 | #endif // WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_IMPL_H |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 113 | |