niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +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_CODEC_IMPL_H |
| 12 | #define WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H |
| 13 | |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 14 | #include "webrtc/voice_engine/include/voe_codec.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 15 | |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 16 | #include "webrtc/voice_engine/shared_data.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc |
| 19 | { |
| 20 | |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 21 | class VoECodecImpl: public VoECodec |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | { |
| 23 | public: |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 24 | virtual int NumOfCodecs(); |
| 25 | |
| 26 | virtual int GetCodec(int index, CodecInst& codec); |
| 27 | |
| 28 | virtual int SetSendCodec(int channel, const CodecInst& codec); |
| 29 | |
| 30 | virtual int GetSendCodec(int channel, CodecInst& codec); |
| 31 | |
| 32 | virtual int GetRecCodec(int channel, CodecInst& codec); |
| 33 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | virtual int SetSendCNPayloadType( |
| 35 | int channel, int type, |
| 36 | PayloadFrequencies frequency = kFreq16000Hz); |
| 37 | |
| 38 | virtual int SetRecPayloadType(int channel, |
| 39 | const CodecInst& codec); |
| 40 | |
| 41 | virtual int GetRecPayloadType(int channel, CodecInst& codec); |
| 42 | |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 43 | virtual int SetFECStatus(int channel, bool enable); |
| 44 | |
| 45 | virtual int GetFECStatus(int channel, bool& enabled); |
| 46 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 47 | virtual int SetVADStatus(int channel, |
| 48 | bool enable, |
| 49 | VadModes mode = kVadConventional, |
| 50 | bool disableDTX = false); |
| 51 | |
| 52 | virtual int GetVADStatus(int channel, |
| 53 | bool& enabled, |
| 54 | VadModes& mode, |
| 55 | bool& disabledDTX); |
| 56 | |
minyue@webrtc.org | adee8f9 | 2014-09-03 12:28:06 +0000 | [diff] [blame] | 57 | virtual int SetOpusMaxPlaybackRate(int channel, int frequency_hz); |
minyue@webrtc.org | 6aac93b | 2014-08-12 08:13:33 +0000 | [diff] [blame] | 58 | |
minyue@webrtc.org | 9b2e114 | 2015-03-13 09:38:07 +0000 | [diff] [blame^] | 59 | virtual int SetOpusDtx(int channel, bool enable_dtx); |
| 60 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 61 | protected: |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 62 | VoECodecImpl(voe::SharedData* shared); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 63 | virtual ~VoECodecImpl(); |
| 64 | |
| 65 | private: |
| 66 | void ACMToExternalCodecRepresentation(CodecInst& toInst, |
| 67 | const CodecInst& fromInst); |
| 68 | |
| 69 | void ExternalToACMCodecRepresentation(CodecInst& toInst, |
| 70 | const CodecInst& fromInst); |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 71 | |
| 72 | voe::SharedData* _shared; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 73 | }; |
| 74 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 75 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 76 | |
| 77 | #endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H |