blob: d24bbac2e5e0d1f8250d5d9505cae6820621a172 [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
Jelena Marusic0d266052015-05-04 14:15:32 +020018namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000019
Jelena Marusic0d266052015-05-04 14:15:32 +020020class VoECodecImpl : public VoECodec {
21 public:
22 int NumOfCodecs() override;
niklase@google.com470e71d2011-07-07 08:21:25 +000023
Jelena Marusic0d266052015-05-04 14:15:32 +020024 int GetCodec(int index, CodecInst& codec) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000025
Jelena Marusic0d266052015-05-04 14:15:32 +020026 int SetSendCodec(int channel, const CodecInst& codec) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000027
Jelena Marusic0d266052015-05-04 14:15:32 +020028 int GetSendCodec(int channel, CodecInst& codec) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000029
Jelena Marusic0d266052015-05-04 14:15:32 +020030 int SetBitRate(int channel, int bitrate_bps) override;
Ivo Creusenadf89b72015-04-29 16:03:33 +020031
Jelena Marusic0d266052015-05-04 14:15:32 +020032 int GetRecCodec(int channel, CodecInst& codec) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000033
Jelena Marusic0d266052015-05-04 14:15:32 +020034 int SetSendCNPayloadType(
35 int channel,
36 int type,
37 PayloadFrequencies frequency = kFreq16000Hz) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000038
Jelena Marusic0d266052015-05-04 14:15:32 +020039 int SetRecPayloadType(int channel, const CodecInst& codec) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000040
Jelena Marusic0d266052015-05-04 14:15:32 +020041 int GetRecPayloadType(int channel, CodecInst& codec) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000042
Jelena Marusic0d266052015-05-04 14:15:32 +020043 int SetFECStatus(int channel, bool enable) override;
minyue@webrtc.orgc1a40a72014-05-28 09:52:06 +000044
Jelena Marusic0d266052015-05-04 14:15:32 +020045 int GetFECStatus(int channel, bool& enabled) override;
minyue@webrtc.orgc1a40a72014-05-28 09:52:06 +000046
Jelena Marusic0d266052015-05-04 14:15:32 +020047 int SetVADStatus(int channel,
48 bool enable,
49 VadModes mode = kVadConventional,
50 bool disableDTX = false) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000051
Jelena Marusic0d266052015-05-04 14:15:32 +020052 int GetVADStatus(int channel,
53 bool& enabled,
54 VadModes& mode,
55 bool& disabledDTX) override;
niklase@google.com470e71d2011-07-07 08:21:25 +000056
Jelena Marusic0d266052015-05-04 14:15:32 +020057 int SetOpusMaxPlaybackRate(int channel, int frequency_hz) override;
minyue@webrtc.org6aac93b2014-08-12 08:13:33 +000058
Jelena Marusic0d266052015-05-04 14:15:32 +020059 int SetOpusDtx(int channel, bool enable_dtx) override;
minyue@webrtc.org9b2e1142015-03-13 09:38:07 +000060
ivoc85228d62016-07-27 04:53:47 -070061 int GetOpusDtxStatus(int channel, bool* enabled) override;
62
Jelena Marusic0d266052015-05-04 14:15:32 +020063 protected:
64 VoECodecImpl(voe::SharedData* shared);
65 ~VoECodecImpl() override;
niklase@google.com470e71d2011-07-07 08:21:25 +000066
Jelena Marusic0d266052015-05-04 14:15:32 +020067 private:
Jelena Marusic0d266052015-05-04 14:15:32 +020068 voe::SharedData* _shared;
niklase@google.com470e71d2011-07-07 08:21:25 +000069};
70
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000071} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000072
73#endif // WEBRTC_VOICE_ENGINE_VOE_CODEC_IMPL_H