blob: f001df86602cc3354be5607211ec2148f9bea883 [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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.org471ae722013-05-21 13:52:32 +000014#include "webrtc/voice_engine/include/voe_codec.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000015
pbos@webrtc.org471ae722013-05-21 13:52:32 +000016#include "webrtc/voice_engine/shared_data.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000017
18namespace webrtc
19{
20
21class VoECodecImpl: public VoECodec
22{
23public:
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
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +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
minyue@webrtc.orgdd671de2014-05-28 09:52:06 +000043 virtual int SetFECStatus(int channel, bool enable);
44
45 virtual int GetFECStatus(int channel, bool& enabled);
46
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000047 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.orgb0aac712014-09-03 12:28:06 +000057 virtual int SetOpusMaxPlaybackRate(int channel, int frequency_hz);
minyue@webrtc.org1bfd5402014-08-12 08:13:33 +000058
turaj@webrtc.org7db52902012-12-11 02:15:12 +000059 // Dual-streaming
60 virtual int SetSecondarySendCodec(int channel, const CodecInst& codec,
61 int red_payload_type);
62
63 virtual int RemoveSecondarySendCodec(int channel);
64
65 virtual int GetSecondarySendCodec(int channel, CodecInst& codec);
66
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000067protected:
68 VoECodecImpl(voe::SharedData* shared);
69 virtual ~VoECodecImpl();
70
71private:
72 void ACMToExternalCodecRepresentation(CodecInst& toInst,
73 const CodecInst& fromInst);
74
75 void ExternalToACMCodecRepresentation(CodecInst& toInst,
76 const CodecInst& fromInst);
77
78 voe::SharedData* _shared;
79};
80
pbos@webrtc.org3b89e102013-07-03 15:12:26 +000081} // namespace webrtc
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000082
83#endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H