blob: 1d2b9c5efd70da7d5444dba67b4da6bcc1161b45 [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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.org471ae722013-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"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000017
18#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000019#include "webrtc/voice_engine/voe_audio_processing_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000020#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000021#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000022#include "webrtc/voice_engine/voe_codec_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000023#endif
24#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000025#include "webrtc/voice_engine/voe_dtmf_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000026#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000027#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000028#include "webrtc/voice_engine/voe_external_media_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000029#endif
30#ifdef WEBRTC_VOICE_ENGINE_FILE_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000031#include "webrtc/voice_engine/voe_file_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000032#endif
33#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000034#include "webrtc/voice_engine/voe_hardware_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000035#endif
36#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000037#include "webrtc/voice_engine/voe_neteq_stats_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000038#endif
pbos@webrtc.org471ae722013-05-21 13:52:32 +000039#include "webrtc/voice_engine/voe_network_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000040#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000041#include "webrtc/voice_engine/voe_rtp_rtcp_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000042#endif
43#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000044#include "webrtc/voice_engine/voe_video_sync_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000045#endif
46#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
pbos@webrtc.org471ae722013-05-21 13:52:32 +000047#include "webrtc/voice_engine/voe_volume_control_impl.h"
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000048#endif
49
50namespace webrtc
51{
52
53class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
tommi@webrtc.orgb9e5a3d2013-02-15 15:07:32 +000054 public VoiceEngine,
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000055#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
56 public VoEAudioProcessingImpl,
57#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000058#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
59 public VoECodecImpl,
60#endif
61#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
62 public VoEDtmfImpl,
63#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000064#ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API
65 public VoEExternalMediaImpl,
66#endif
67#ifdef WEBRTC_VOICE_ENGINE_FILE_API
68 public VoEFileImpl,
69#endif
70#ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API
71 public VoEHardwareImpl,
72#endif
73#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
74 public VoENetEqStatsImpl,
75#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000076 public VoENetworkImpl,
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000077#ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API
78 public VoERTP_RTCPImpl,
79#endif
80#ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API
81 public VoEVideoSyncImpl,
82#endif
83#ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API
84 public VoEVolumeControlImpl,
85#endif
86 public VoEBaseImpl
87{
88public:
minyue@webrtc.org4489c512013-09-12 17:03:00 +000089 VoiceEngineImpl(const Config* config, bool owns_config) :
90 SharedData(*config),
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000091#ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API
92 VoEAudioProcessingImpl(this),
93#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000094#ifdef WEBRTC_VOICE_ENGINE_CODEC_API
95 VoECodecImpl(this),
96#endif
97#ifdef WEBRTC_VOICE_ENGINE_DTMF_API
98 VoEDtmfImpl(this),
99#endif
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +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
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000112 VoENetworkImpl(this),
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +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
122 VoEBaseImpl(this),
minyue@webrtc.org4489c512013-09-12 17:03:00 +0000123 _ref_count(0),
124 own_config_(owns_config ? config : NULL)
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000125 {
126 }
127 virtual ~VoiceEngineImpl()
128 {
129 assert(_ref_count.Value() == 0);
130 }
131
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;
minyue@webrtc.org4489c512013-09-12 17:03:00 +0000139 scoped_ptr<const Config> own_config_;
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000140};
141
pbos@webrtc.org3b89e102013-07-03 15:12:26 +0000142} // namespace webrtc
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000143
144#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H