blob: 8e8ac38ccf1628d7029794bb6fe69dcd516101fb [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tommi@webrtc.org851becd2012-04-04 14:57:19 +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_CODEC_IMPL_H
12#define WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H
13
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000014#include "webrtc/voice_engine/include/voe_codec.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
18namespace webrtc
19{
20
tommi@webrtc.orga990e122012-04-26 15:28:22 +000021class VoECodecImpl: public VoECodec
niklase@google.com470e71d2011-07-07 08:21:25 +000022{
23public:
niklase@google.com470e71d2011-07-07 08:21:25 +000024 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
Ivo Creusenadf89b72015-04-29 16:03:33 +020032 int SetBitRate(int channel, int bitrate_bps) override;
33
niklase@google.com470e71d2011-07-07 08:21:25 +000034 virtual int GetRecCodec(int channel, CodecInst& codec);
35
niklase@google.com470e71d2011-07-07 08:21:25 +000036 virtual int SetSendCNPayloadType(
37 int channel, int type,
38 PayloadFrequencies frequency = kFreq16000Hz);
39
40 virtual int SetRecPayloadType(int channel,
41 const CodecInst& codec);
42
43 virtual int GetRecPayloadType(int channel, CodecInst& codec);
44
minyue@webrtc.orgc1a40a72014-05-28 09:52:06 +000045 virtual int SetFECStatus(int channel, bool enable);
46
47 virtual int GetFECStatus(int channel, bool& enabled);
48
niklase@google.com470e71d2011-07-07 08:21:25 +000049 virtual int SetVADStatus(int channel,
50 bool enable,
51 VadModes mode = kVadConventional,
52 bool disableDTX = false);
53
54 virtual int GetVADStatus(int channel,
55 bool& enabled,
56 VadModes& mode,
57 bool& disabledDTX);
58
minyue@webrtc.orgadee8f92014-09-03 12:28:06 +000059 virtual int SetOpusMaxPlaybackRate(int channel, int frequency_hz);
minyue@webrtc.org6aac93b2014-08-12 08:13:33 +000060
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +000061 virtual int SetOpusDtx(int channel, bool enable_dtx);
62
niklase@google.com470e71d2011-07-07 08:21:25 +000063protected:
tommi@webrtc.org851becd2012-04-04 14:57:19 +000064 VoECodecImpl(voe::SharedData* shared);
niklase@google.com470e71d2011-07-07 08:21:25 +000065 virtual ~VoECodecImpl();
66
67private:
68 void ACMToExternalCodecRepresentation(CodecInst& toInst,
69 const CodecInst& fromInst);
70
71 void ExternalToACMCodecRepresentation(CodecInst& toInst,
72 const CodecInst& fromInst);
tommi@webrtc.org851becd2012-04-04 14:57:19 +000073
74 voe::SharedData* _shared;
niklase@google.com470e71d2011-07-07 08:21:25 +000075};
76
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000077} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000078
79#endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H