OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H | 11 #ifndef WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |
12 #define WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H | 12 #define WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/system_wrappers/include/atomic32.h" | 16 #include "webrtc/system_wrappers/include/atomic32.h" |
| 17 #include "webrtc/voice_engine_configurations.h" |
17 #include "webrtc/voice_engine/voe_base_impl.h" | 18 #include "webrtc/voice_engine/voe_base_impl.h" |
18 #include "webrtc/voice_engine_configurations.h" | |
19 | |
20 #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 | |
48 #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API | |
49 #include "webrtc/voice_engine/voe_audio_processing_impl.h" | 19 #include "webrtc/voice_engine/voe_audio_processing_impl.h" |
50 #endif | |
51 #ifdef WEBRTC_VOICE_ENGINE_CODEC_API | |
52 #include "webrtc/voice_engine/voe_codec_impl.h" | 20 #include "webrtc/voice_engine/voe_codec_impl.h" |
53 #endif | |
54 #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API | |
55 #include "webrtc/voice_engine/voe_external_media_impl.h" | 21 #include "webrtc/voice_engine/voe_external_media_impl.h" |
56 #endif | |
57 #ifdef WEBRTC_VOICE_ENGINE_FILE_API | |
58 #include "webrtc/voice_engine/voe_file_impl.h" | 22 #include "webrtc/voice_engine/voe_file_impl.h" |
59 #endif | |
60 #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API | |
61 #include "webrtc/voice_engine/voe_hardware_impl.h" | 23 #include "webrtc/voice_engine/voe_hardware_impl.h" |
62 #endif | |
63 #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
64 #include "webrtc/voice_engine/voe_neteq_stats_impl.h" | 24 #include "webrtc/voice_engine/voe_neteq_stats_impl.h" |
65 #endif | |
66 #include "webrtc/voice_engine/voe_network_impl.h" | 25 #include "webrtc/voice_engine/voe_network_impl.h" |
67 #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API | |
68 #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" | 26 #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" |
69 #endif | |
70 #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API | |
71 #include "webrtc/voice_engine/voe_video_sync_impl.h" | 27 #include "webrtc/voice_engine/voe_video_sync_impl.h" |
72 #endif | |
73 #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API | |
74 #include "webrtc/voice_engine/voe_volume_control_impl.h" | 28 #include "webrtc/voice_engine/voe_volume_control_impl.h" |
75 #endif | |
76 | 29 |
77 namespace webrtc { | 30 namespace webrtc { |
78 namespace voe { | 31 namespace voe { |
79 class ChannelProxy; | 32 class ChannelProxy; |
80 } // namespace voe | 33 } // namespace voe |
81 | 34 |
82 class VoiceEngineImpl : public voe::SharedData, // Must be the first base class | 35 class VoiceEngineImpl : public voe::SharedData, // Must be the first base class |
83 public VoiceEngine, | 36 public VoiceEngine, |
84 #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API | |
85 public VoEAudioProcessingImpl, | 37 public VoEAudioProcessingImpl, |
86 #endif | |
87 #ifdef WEBRTC_VOICE_ENGINE_CODEC_API | |
88 public VoECodecImpl, | 38 public VoECodecImpl, |
89 #endif | |
90 #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API | |
91 public VoEExternalMediaImpl, | 39 public VoEExternalMediaImpl, |
92 #endif | |
93 #ifdef WEBRTC_VOICE_ENGINE_FILE_API | |
94 public VoEFileImpl, | 40 public VoEFileImpl, |
95 #endif | |
96 #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API | |
97 public VoEHardwareImpl, | 41 public VoEHardwareImpl, |
98 #endif | |
99 #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
100 public VoENetEqStatsImpl, | 42 public VoENetEqStatsImpl, |
101 #endif | |
102 public VoENetworkImpl, | 43 public VoENetworkImpl, |
103 #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API | |
104 public VoERTP_RTCPImpl, | 44 public VoERTP_RTCPImpl, |
105 #endif | |
106 #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API | |
107 public VoEVideoSyncImpl, | 45 public VoEVideoSyncImpl, |
108 #endif | |
109 #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API | |
110 public VoEVolumeControlImpl, | 46 public VoEVolumeControlImpl, |
111 #endif | |
112 public VoEBaseImpl { | 47 public VoEBaseImpl { |
113 public: | 48 public: |
114 VoiceEngineImpl() | 49 VoiceEngineImpl() |
115 : SharedData(), | 50 : SharedData(), |
116 #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API | |
117 VoEAudioProcessingImpl(this), | 51 VoEAudioProcessingImpl(this), |
118 #endif | |
119 #ifdef WEBRTC_VOICE_ENGINE_CODEC_API | |
120 VoECodecImpl(this), | 52 VoECodecImpl(this), |
121 #endif | |
122 #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API | |
123 VoEExternalMediaImpl(this), | 53 VoEExternalMediaImpl(this), |
124 #endif | |
125 #ifdef WEBRTC_VOICE_ENGINE_FILE_API | |
126 VoEFileImpl(this), | 54 VoEFileImpl(this), |
127 #endif | |
128 #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API | |
129 VoEHardwareImpl(this), | 55 VoEHardwareImpl(this), |
130 #endif | |
131 #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API | |
132 VoENetEqStatsImpl(this), | 56 VoENetEqStatsImpl(this), |
133 #endif | |
134 VoENetworkImpl(this), | 57 VoENetworkImpl(this), |
135 #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API | |
136 VoERTP_RTCPImpl(this), | 58 VoERTP_RTCPImpl(this), |
137 #endif | |
138 #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API | |
139 VoEVideoSyncImpl(this), | 59 VoEVideoSyncImpl(this), |
140 #endif | |
141 #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API | |
142 VoEVolumeControlImpl(this), | 60 VoEVolumeControlImpl(this), |
143 #endif | |
144 VoEBaseImpl(this), | 61 VoEBaseImpl(this), |
145 _ref_count(0) {} | 62 _ref_count(0) {} |
146 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); } | 63 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); } |
147 | 64 |
148 int AddRef(); | 65 int AddRef(); |
149 | 66 |
150 // This implements the Release() method for all the inherited interfaces. | 67 // This implements the Release() method for all the inherited interfaces. |
151 int Release() override; | 68 int Release() override; |
152 | 69 |
153 // Backdoor to access a voe::Channel object without a channel ID. This is only | 70 // Backdoor to access a voe::Channel object without a channel ID. This is only |
154 // to be used while refactoring the VoE API! | 71 // to be used while refactoring the VoE API! |
155 virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id); | 72 virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id); |
156 | 73 |
157 // This is *protected* so that FakeVoiceEngine can inherit from the class and | 74 // This is *protected* so that FakeVoiceEngine can inherit from the class and |
158 // manipulate the reference count. See: fake_voice_engine.h. | 75 // manipulate the reference count. See: fake_voice_engine.h. |
159 protected: | 76 protected: |
160 Atomic32 _ref_count; | 77 Atomic32 _ref_count; |
161 }; | 78 }; |
162 | 79 |
163 } // namespace webrtc | 80 } // namespace webrtc |
164 | 81 |
165 #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H | 82 #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |
OLD | NEW |