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 | |
| 34 | virtual int SetAMREncFormat(int channel, |
| 35 | AmrMode mode = kRfc3267BwEfficient); |
| 36 | |
| 37 | virtual int SetAMRDecFormat(int channel, |
| 38 | AmrMode mode = kRfc3267BwEfficient); |
| 39 | |
| 40 | virtual int SetAMRWbEncFormat(int channel, |
| 41 | AmrMode mode = kRfc3267BwEfficient); |
| 42 | |
| 43 | virtual int SetAMRWbDecFormat(int channel, |
| 44 | AmrMode mode = kRfc3267BwEfficient); |
| 45 | |
| 46 | virtual int SetSendCNPayloadType( |
| 47 | int channel, int type, |
| 48 | PayloadFrequencies frequency = kFreq16000Hz); |
| 49 | |
| 50 | virtual int SetRecPayloadType(int channel, |
| 51 | const CodecInst& codec); |
| 52 | |
| 53 | virtual int GetRecPayloadType(int channel, CodecInst& codec); |
| 54 | |
| 55 | virtual int SetISACInitTargetRate(int channel, |
| 56 | int rateBps, |
| 57 | bool useFixedFrameSize = false); |
| 58 | |
| 59 | virtual int SetISACMaxRate(int channel, int rateBps); |
| 60 | |
| 61 | virtual int SetISACMaxPayloadSize(int channel, int sizeBytes); |
| 62 | |
| 63 | virtual int SetVADStatus(int channel, |
| 64 | bool enable, |
| 65 | VadModes mode = kVadConventional, |
| 66 | bool disableDTX = false); |
| 67 | |
| 68 | virtual int GetVADStatus(int channel, |
| 69 | bool& enabled, |
| 70 | VadModes& mode, |
| 71 | bool& disabledDTX); |
| 72 | |
turaj@webrtc.org | 42259e7 | 2012-12-11 02:15:12 +0000 | [diff] [blame] | 73 | // Dual-streaming |
| 74 | virtual int SetSecondarySendCodec(int channel, const CodecInst& codec, |
| 75 | int red_payload_type); |
| 76 | |
| 77 | virtual int RemoveSecondarySendCodec(int channel); |
| 78 | |
| 79 | virtual int GetSecondarySendCodec(int channel, CodecInst& codec); |
| 80 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 81 | protected: |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 82 | VoECodecImpl(voe::SharedData* shared); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 83 | virtual ~VoECodecImpl(); |
| 84 | |
| 85 | private: |
| 86 | void ACMToExternalCodecRepresentation(CodecInst& toInst, |
| 87 | const CodecInst& fromInst); |
| 88 | |
| 89 | void ExternalToACMCodecRepresentation(CodecInst& toInst, |
| 90 | const CodecInst& fromInst); |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 91 | |
| 92 | voe::SharedData* _shared; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | } // namespace webrtc |
| 96 | |
| 97 | #endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H |