blob: d8aebdc83fb4efa96de34581791bd20123251d30 [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
20#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000021#include "webrtc/voice_engine/voe_audio_processing_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000022#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000023#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000024#include "webrtc/voice_engine/voe_codec_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000025#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000026#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000027#include "webrtc/voice_engine/voe_external_media_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000028#endif
29#ifdef WEBRTC_VOICE_ENGINE_FILE_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000030#include "webrtc/voice_engine/voe_file_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000031#endif
32#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000033#include "webrtc/voice_engine/voe_hardware_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000034#endif
35#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000036#include "webrtc/voice_engine/voe_neteq_stats_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000037#endif
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000038#include "webrtc/voice_engine/voe_network_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000039#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000040#include "webrtc/voice_engine/voe_rtp_rtcp_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000041#endif
42#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000043#include "webrtc/voice_engine/voe_video_sync_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000044#endif
45#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000046#include "webrtc/voice_engine/voe_volume_control_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000047#endif
48
Jelena Marusic0d266052015-05-04 14:15:32 +020049namespace webrtc {
solenberg13725082015-11-25 08:16:52 -080050namespace voe {
51class ChannelProxy;
52} // namespace voe
niklase@google.com470e71d2011-07-07 08:21:25 +000053
tommi@webrtc.org851becd2012-04-04 14:57:19 +000054class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
tommi@webrtc.org0989fb72013-02-15 15:07:32 +000055 public VoiceEngine,
niklase@google.com470e71d2011-07-07 08:21:25 +000056#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000057 public VoEAudioProcessingImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000058#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000059#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000060 public VoECodecImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000061#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000062#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000063 public VoEExternalMediaImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000064#endif
65#ifdef WEBRTC_VOICE_ENGINE_FILE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000066 public VoEFileImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000067#endif
68#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000069 public VoEHardwareImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000070#endif
71#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000072 public VoENetEqStatsImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000073#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000074 public VoENetworkImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000075#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000076 public VoERTP_RTCPImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000077#endif
78#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000079 public VoEVideoSyncImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000080#endif
81#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000082 public VoEVolumeControlImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000083#endif
Jelena Marusic0d266052015-05-04 14:15:32 +020084 public VoEBaseImpl {
85 public:
solenberg88499ec2016-09-07 07:34:41 -070086 VoiceEngineImpl()
87 : SharedData(),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000088#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
89 VoEAudioProcessingImpl(this),
tommi@webrtc.org9ff87db2012-01-19 15:05:36 +000090#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000091#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
92 VoECodecImpl(this),
93#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000094#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
95 VoEExternalMediaImpl(this),
96#endif
97#ifdef WEBRTC_VOICE_ENGINE_FILE_API
98 VoEFileImpl(this),
99#endif
100#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
101 VoEHardwareImpl(this),
102#endif
103#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
104 VoENetEqStatsImpl(this),
105#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000106 VoENetworkImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000107#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
108 VoERTP_RTCPImpl(this),
109#endif
110#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
111 VoEVideoSyncImpl(this),
112#endif
113#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
114 VoEVolumeControlImpl(this),
115#endif
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000116 VoEBaseImpl(this),
solenberg88499ec2016-09-07 07:34:41 -0700117 _ref_count(0) {}
Jelena Marusic0d266052015-05-04 14:15:32 +0200118 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000119
Jelena Marusic0d266052015-05-04 14:15:32 +0200120 int AddRef();
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000121
Jelena Marusic0d266052015-05-04 14:15:32 +0200122 // This implements the Release() method for all the inherited interfaces.
123 int Release() override;
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000124
solenberg13725082015-11-25 08:16:52 -0800125 // Backdoor to access a voe::Channel object without a channel ID. This is only
126 // to be used while refactoring the VoE API!
kwibergb7f89d62016-02-17 10:04:18 -0800127 virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id);
solenberg13725082015-11-25 08:16:52 -0800128
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +0200129 // This is *protected* so that FakeVoiceEngine can inherit from the class and
130 // manipulate the reference count. See: fake_voice_engine.h.
131 protected:
Jelena Marusic0d266052015-05-04 14:15:32 +0200132 Atomic32 _ref_count;
niklase@google.com470e71d2011-07-07 08:21:25 +0000133};
134
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000135} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000136
Jelena Marusic0d266052015-05-04 14:15:32 +0200137#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H