blob: 07f29c37b9aa177323ea88d154d16673e32a204e [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
Jelena Marusic0d266052015-05-04 14:15:32 +020050namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000051
tommi@webrtc.org851becd2012-04-04 14:57:19 +000052class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
tommi@webrtc.org0989fb72013-02-15 15:07:32 +000053 public VoiceEngine,
niklase@google.com470e71d2011-07-07 08:21:25 +000054#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000055 public VoEAudioProcessingImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000056#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000057#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000058 public VoECodecImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000059#endif
60#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000061 public VoEDtmfImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000062#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000063#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000064 public VoEExternalMediaImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000065#endif
66#ifdef WEBRTC_VOICE_ENGINE_FILE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000067 public VoEFileImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000068#endif
69#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000070 public VoEHardwareImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000071#endif
72#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000073 public VoENetEqStatsImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000074#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000075 public VoENetworkImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000076#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000077 public VoERTP_RTCPImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000078#endif
79#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000080 public VoEVideoSyncImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000081#endif
82#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
tommi@webrtc.org851becd2012-04-04 14:57:19 +000083 public VoEVolumeControlImpl,
niklase@google.com470e71d2011-07-07 08:21:25 +000084#endif
Jelena Marusic0d266052015-05-04 14:15:32 +020085 public VoEBaseImpl {
86 public:
87 VoiceEngineImpl(const Config* config, bool owns_config)
88 : SharedData(*config),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000089#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
90 VoEAudioProcessingImpl(this),
tommi@webrtc.org9ff87db2012-01-19 15:05:36 +000091#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000092#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
93 VoECodecImpl(this),
94#endif
95#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
96 VoEDtmfImpl(this),
97#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +000098#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
99 VoEExternalMediaImpl(this),
100#endif
101#ifdef WEBRTC_VOICE_ENGINE_FILE_API
102 VoEFileImpl(this),
103#endif
104#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
105 VoEHardwareImpl(this),
106#endif
107#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
108 VoENetEqStatsImpl(this),
109#endif
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000110 VoENetworkImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +0000111#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
112 VoERTP_RTCPImpl(this),
113#endif
114#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
115 VoEVideoSyncImpl(this),
116#endif
117#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
118 VoEVolumeControlImpl(this),
119#endif
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000120 VoEBaseImpl(this),
minyue@webrtc.orge509f942013-09-12 17:03:00 +0000121 _ref_count(0),
Jelena Marusic0d266052015-05-04 14:15:32 +0200122 own_config_(owns_config ? config : NULL) {
123 }
124 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000125
Jelena Marusic0d266052015-05-04 14:15:32 +0200126 int AddRef();
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000127
Jelena Marusic0d266052015-05-04 14:15:32 +0200128 // This implements the Release() method for all the inherited interfaces.
129 int Release() override;
tommi@webrtc.orga990e122012-04-26 15:28:22 +0000130
Jelena Marusic0d266052015-05-04 14:15:32 +0200131 private:
132 Atomic32 _ref_count;
133 rtc::scoped_ptr<const Config> own_config_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000134};
135
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000136} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000137
Jelena Marusic0d266052015-05-04 14:15:32 +0200138#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H