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 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 18 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 20 | class VoECodecImpl : public VoECodec { |
| 21 | public: |
| 22 | int NumOfCodecs() override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 23 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 24 | int GetCodec(int index, CodecInst& codec) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 26 | int SetSendCodec(int channel, const CodecInst& codec) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 28 | int GetSendCodec(int channel, CodecInst& codec) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 30 | int SetBitRate(int channel, int bitrate_bps) override; |
Ivo Creusen | adf89b7 | 2015-04-29 16:03:33 +0200 | [diff] [blame] | 31 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 32 | int GetRecCodec(int channel, CodecInst& codec) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 34 | int SetSendCNPayloadType( |
| 35 | int channel, |
| 36 | int type, |
| 37 | PayloadFrequencies frequency = kFreq16000Hz) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 38 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 39 | int SetRecPayloadType(int channel, const CodecInst& codec) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 40 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 41 | int GetRecPayloadType(int channel, CodecInst& codec) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 43 | int SetFECStatus(int channel, bool enable) override; |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 44 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 45 | int GetFECStatus(int channel, bool& enabled) override; |
minyue@webrtc.org | c1a40a7 | 2014-05-28 09:52:06 +0000 | [diff] [blame] | 46 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 47 | int SetVADStatus(int channel, |
| 48 | bool enable, |
| 49 | VadModes mode = kVadConventional, |
| 50 | bool disableDTX = false) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 52 | int GetVADStatus(int channel, |
| 53 | bool& enabled, |
| 54 | VadModes& mode, |
| 55 | bool& disabledDTX) override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 57 | int SetOpusMaxPlaybackRate(int channel, int frequency_hz) override; |
minyue@webrtc.org | 6aac93b | 2014-08-12 08:13:33 +0000 | [diff] [blame] | 58 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 59 | int SetOpusDtx(int channel, bool enable_dtx) override; |
minyue@webrtc.org | 9b2e114 | 2015-03-13 09:38:07 +0000 | [diff] [blame] | 60 | |
ivoc | 85228d6 | 2016-07-27 04:53:47 -0700 | [diff] [blame] | 61 | int GetOpusDtxStatus(int channel, bool* enabled) override; |
| 62 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 63 | protected: |
| 64 | VoECodecImpl(voe::SharedData* shared); |
| 65 | ~VoECodecImpl() override; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 66 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 67 | private: |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 68 | voe::SharedData* _shared; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 71 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | |
| 73 | #endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H |