blob: 6757695f1be4c80312e363b640897f691296a777 [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
32 virtual int GetRecCodec(int channel, CodecInst& codec);
33
niklase@google.com470e71d2011-07-07 08:21:25 +000034 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
niklase@google.com470e71d2011-07-07 08:21:25 +000043 virtual int SetVADStatus(int channel,
44 bool enable,
45 VadModes mode = kVadConventional,
46 bool disableDTX = false);
47
48 virtual int GetVADStatus(int channel,
49 bool& enabled,
50 VadModes& mode,
51 bool& disabledDTX);
52
turaj@webrtc.org42259e72012-12-11 02:15:12 +000053 // Dual-streaming
54 virtual int SetSecondarySendCodec(int channel, const CodecInst& codec,
55 int red_payload_type);
56
57 virtual int RemoveSecondarySendCodec(int channel);
58
59 virtual int GetSecondarySendCodec(int channel, CodecInst& codec);
60
niklase@google.com470e71d2011-07-07 08:21:25 +000061protected:
tommi@webrtc.org851becd2012-04-04 14:57:19 +000062 VoECodecImpl(voe::SharedData* shared);
niklase@google.com470e71d2011-07-07 08:21:25 +000063 virtual ~VoECodecImpl();
64
65private:
66 void ACMToExternalCodecRepresentation(CodecInst& toInst,
67 const CodecInst& fromInst);
68
69 void ExternalToACMCodecRepresentation(CodecInst& toInst,
70 const CodecInst& fromInst);
tommi@webrtc.org851becd2012-04-04 14:57:19 +000071
72 voe::SharedData* _shared;
niklase@google.com470e71d2011-07-07 08:21:25 +000073};
74
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000075} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000076
77#endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H