blob: 992bc2d83e844355ce1bfeb75e4e4bac3d156b67 [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
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000014#include "webrtc/engine_configurations.h"
15#include "webrtc/system_wrappers/interface/atomic32.h"
16#include "webrtc/voice_engine/voe_base_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000017
18#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000019#include "webrtc/voice_engine/voe_audio_processing_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000020#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000021#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000022#include "webrtc/voice_engine/voe_codec_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000023#endif
24#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000025#include "webrtc/voice_engine/voe_dtmf_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000026#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000027#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000028#include "webrtc/voice_engine/voe_external_media_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000029#endif
30#ifdef WEBRTC_VOICE_ENGINE_FILE_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000031#include "webrtc/voice_engine/voe_file_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000032#endif
33#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000034#include "webrtc/voice_engine/voe_hardware_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000035#endif
36#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000037#include "webrtc/voice_engine/voe_neteq_stats_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000038#endif
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000039#include "webrtc/voice_engine/voe_network_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000040#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000041#include "webrtc/voice_engine/voe_rtp_rtcp_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000042#endif
43#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000044#include "webrtc/voice_engine/voe_video_sync_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000045#endif
46#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000047#include "webrtc/voice_engine/voe_volume_control_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000048#endif
49
50namespace webrtc
51{
52
tommi@webrtc.org851becd2012-04-04 14:57:19 +000053class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
tommi@webrtc.org0989fb72013-02-15 15:07:32 +000054 public VoiceEngine,
niklase@google.com470e71d2011-07-07 08:21:25 +000055#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000056 public VoEAudioProcessingImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000057#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000058#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000059 public VoECodecImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000060#endif
61#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000062 public VoEDtmfImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000063#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000064#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000065 public VoEExternalMediaImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000066#endif
67#ifdef WEBRTC_VOICE_ENGINE_FILE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000068 public VoEFileImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000069#endif
70#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000071 public VoEHardwareImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000072#endif
73#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000074 public VoENetEqStatsImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000075#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000076 public VoENetworkImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000077#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000078 public VoERTP_RTCPImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000079#endif
80#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000081 public VoEVideoSyncImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000082#endif
83#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000084 public VoEVolumeControlImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000085#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000086 public VoEBaseImpl
niklase@google.com470e71d2011-07-07 08:21:25 +000087{
88public:
minyue@webrtc.orge509f942013-09-12 17:03:00 +000089 VoiceEngineImpl(const Config* config, bool owns_config) :
90 SharedData(*config),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000091#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
92 VoEAudioProcessingImpl(this),
tommi@webrtc.org9ff87db2012-01-19 15:05:36 +000093#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000094#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
95 VoECodecImpl(this),
96#endif
97#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
98 VoEDtmfImpl(this),
99#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000100#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
101 VoEExternalMediaImpl(this),
102#endif
103#ifdef WEBRTC_VOICE_ENGINE_FILE_API
104 VoEFileImpl(this),
105#endif
106#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
107 VoEHardwareImpl(this),
108#endif
109#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
110 VoENetEqStatsImpl(this),
111#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000112 VoENetworkImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000113#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
114 VoERTP_RTCPImpl(this),
115#endif
116#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
117 VoEVideoSyncImpl(this),
118#endif
119#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
120 VoEVolumeControlImpl(this),
121#endif
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000122 VoEBaseImpl(this),
minyue@webrtc.orge509f942013-09-12 17:03:00 +0000123 _ref_count(0),
124 own_config_(owns_config ? config : NULL)
niklase@google.com470e71d2011-07-07 08:21:25 +0000125 {
tommi@webrtc.org9ff87db2012-01-19 15:05:36 +0000126 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000127 virtual ~VoiceEngineImpl()
128 {
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000129 assert(_ref_count.Value() == 0);
tommi@webrtc.org9ff87db2012-01-19 15:05:36 +0000130 }
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000131
132 int AddRef();
133
134 // This implements the Release() method for all the inherited interfaces.
135 virtual int Release();
136
137private:
138 Atomic32 _ref_count;
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +0000139 rtc::scoped_ptr<const Config> own_config_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000140};
141
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000142} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000143
144#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H