blob: 0ce5ca8e1b99cb7ab4d33606810743a1bc223171 [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_VOICE_ENGINE_IMPL_H
12#define WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H
13
kwibergb7f89d62016-02-17 10:04:18 -080014#include <memory>
15
Henrik Kjellander98f53512015-10-28 18:17:40 +010016#include "webrtc/system_wrappers/include/atomic32.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000017#include "webrtc/voice_engine/voe_base_impl.h"
mflodman7056be92016-10-07 07:07:28 +020018#include "webrtc/voice_engine_configurations.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000019
henrik.lundin06c1d642016-11-30 08:21:46 -080020#ifndef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
21#error "Deprecated"
22#endif
23#ifndef WEBRTC_VOICE_ENGINE_CODEC_API
24#error "Deprecated"
25#endif
26#ifndef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
27#error "Deprecated"
28#endif
29#ifndef WEBRTC_VOICE_ENGINE_FILE_API
30#error "Deprecated"
31#endif
32#ifndef WEBRTC_VOICE_ENGINE_HARDWARE_API
33#error "Deprecated"
34#endif
35#ifndef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
36#error "Deprecated"
37#endif
38#ifndef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
39#error "Deprecated"
40#endif
41#ifndef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
42#error "Deprecated"
43#endif
44#ifndef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
45#error "Deprecated"
46#endif
47
niklase@google.com470e71d2011-07-07 08:21:25 +000048#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000049#include "webrtc/voice_engine/voe_audio_processing_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000050#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000051#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000052#include "webrtc/voice_engine/voe_codec_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000053#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000054#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000055#include "webrtc/voice_engine/voe_external_media_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000056#endif
57#ifdef WEBRTC_VOICE_ENGINE_FILE_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000058#include "webrtc/voice_engine/voe_file_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000059#endif
60#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000061#include "webrtc/voice_engine/voe_hardware_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000062#endif
63#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000064#include "webrtc/voice_engine/voe_neteq_stats_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000065#endif
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000066#include "webrtc/voice_engine/voe_network_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000067#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000068#include "webrtc/voice_engine/voe_rtp_rtcp_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000069#endif
70#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000071#include "webrtc/voice_engine/voe_video_sync_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000072#endif
73#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000074#include "webrtc/voice_engine/voe_volume_control_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000075#endif
76
Jelena Marusic0d266052015-05-04 14:15:32 +020077namespace webrtc {
solenberg13725082015-11-25 08:16:52 -080078namespace voe {
79class ChannelProxy;
80} // namespace voe
niklase@google.com470e71d2011-07-07 08:21:25 +000081
tommi@webrtc.org851becd2012-04-04 14:57:19 +000082class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
tommi@webrtc.org0989fb72013-02-15 15:07:32 +000083 public VoiceEngine,
niklase@google.com470e71d2011-07-07 08:21:25 +000084#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000085 public VoEAudioProcessingImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000086#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000087#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000088 public VoECodecImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000089#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000090#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000091 public VoEExternalMediaImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000092#endif
93#ifdef WEBRTC_VOICE_ENGINE_FILE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000094 public VoEFileImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000095#endif
96#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000097 public VoEHardwareImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000098#endif
99#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000100 public VoENetEqStatsImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +0000101#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000102 public VoENetworkImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +0000103#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000104 public VoERTP_RTCPImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +0000105#endif
106#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000107 public VoEVideoSyncImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +0000108#endif
109#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000110 public VoEVolumeControlImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +0000111#endif
Jelena Marusic0d266052015-05-04 14:15:32 +0200112 public VoEBaseImpl {
113 public:
solenberg88499ec2016-09-07 07:34:41 -0700114 VoiceEngineImpl()
115 : SharedData(),
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000116#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
117 VoEAudioProcessingImpl(this),
tommi@webrtc.org9ff87db2012-01-19 15:05:36 +0000118#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000119#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
120 VoECodecImpl(this),
121#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000122#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
123 VoEExternalMediaImpl(this),
124#endif
125#ifdef WEBRTC_VOICE_ENGINE_FILE_API
126 VoEFileImpl(this),
127#endif
128#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
129 VoEHardwareImpl(this),
130#endif
131#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
132 VoENetEqStatsImpl(this),
133#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000134 VoENetworkImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000135#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
136 VoERTP_RTCPImpl(this),
137#endif
138#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
139 VoEVideoSyncImpl(this),
140#endif
141#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
142 VoEVolumeControlImpl(this),
143#endif
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000144 VoEBaseImpl(this),
solenberg88499ec2016-09-07 07:34:41 -0700145 _ref_count(0) {}
Jelena Marusic0d266052015-05-04 14:15:32 +0200146 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000147
Jelena Marusic0d266052015-05-04 14:15:32 +0200148 int AddRef();
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000149
Jelena Marusic0d266052015-05-04 14:15:32 +0200150 // This implements the Release() method for all the inherited interfaces.
151 int Release() override;
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000152
solenberg13725082015-11-25 08:16:52 -0800153 // Backdoor to access a voe::Channel object without a channel ID. This is only
154 // to be used while refactoring the VoE API!
kwibergb7f89d62016-02-17 10:04:18 -0800155 virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id);
solenberg13725082015-11-25 08:16:52 -0800156
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +0200157 // This is *protected* so that FakeVoiceEngine can inherit from the class and
158 // manipulate the reference count. See: fake_voice_engine.h.
159 protected:
Jelena Marusic0d266052015-05-04 14:15:32 +0200160 Atomic32 _ref_count;
niklase@google.com470e71d2011-07-07 08:21:25 +0000161};
162
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000163} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000164
Jelena Marusic0d266052015-05-04 14:15:32 +0200165#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H