niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 14 | #include <memory> |
| 15 | |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 16 | #include "webrtc/system_wrappers/include/atomic32.h" |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 17 | #include "webrtc/voice_engine/voe_base_impl.h" |
mflodman | 7056be9 | 2016-10-07 07:07:28 +0200 | [diff] [blame] | 18 | #include "webrtc/voice_engine_configurations.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 19 | |
henrik.lundin | 06c1d64 | 2016-11-30 08:21:46 -0800 | [diff] [blame] | 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 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 48 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 49 | #include "webrtc/voice_engine/voe_audio_processing_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 50 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 52 | #include "webrtc/voice_engine/voe_codec_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 53 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 55 | #include "webrtc/voice_engine/voe_external_media_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | #endif |
| 57 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 58 | #include "webrtc/voice_engine/voe_file_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 59 | #endif |
| 60 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 61 | #include "webrtc/voice_engine/voe_hardware_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 62 | #endif |
| 63 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 64 | #include "webrtc/voice_engine/voe_neteq_stats_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 65 | #endif |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 66 | #include "webrtc/voice_engine/voe_network_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 67 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 68 | #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 69 | #endif |
| 70 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 71 | #include "webrtc/voice_engine/voe_video_sync_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | #endif |
| 73 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 74 | #include "webrtc/voice_engine/voe_volume_control_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 75 | #endif |
| 76 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 77 | namespace webrtc { |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 78 | namespace voe { |
| 79 | class ChannelProxy; |
| 80 | } // namespace voe |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 81 | |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 82 | class VoiceEngineImpl : public voe::SharedData, // Must be the first base class |
tommi@webrtc.org | 0989fb7 | 2013-02-15 15:07:32 +0000 | [diff] [blame] | 83 | public VoiceEngine, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 84 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 85 | public VoEAudioProcessingImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 86 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 87 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 88 | public VoECodecImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 89 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 90 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 91 | public VoEExternalMediaImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 92 | #endif |
| 93 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 94 | public VoEFileImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 95 | #endif |
| 96 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 97 | public VoEHardwareImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 98 | #endif |
| 99 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 100 | public VoENetEqStatsImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 101 | #endif |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 102 | public VoENetworkImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 103 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 104 | public VoERTP_RTCPImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 105 | #endif |
| 106 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 107 | public VoEVideoSyncImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 108 | #endif |
| 109 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 110 | public VoEVolumeControlImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 111 | #endif |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 112 | public VoEBaseImpl { |
| 113 | public: |
solenberg | 88499ec | 2016-09-07 07:34:41 -0700 | [diff] [blame] | 114 | VoiceEngineImpl() |
| 115 | : SharedData(), |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 116 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
| 117 | VoEAudioProcessingImpl(this), |
tommi@webrtc.org | 9ff87db | 2012-01-19 15:05:36 +0000 | [diff] [blame] | 118 | #endif |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 119 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
| 120 | VoECodecImpl(this), |
| 121 | #endif |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 122 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
| 123 | VoEExternalMediaImpl(this), |
| 124 | #endif |
| 125 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
| 126 | VoEFileImpl(this), |
| 127 | #endif |
| 128 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
| 129 | VoEHardwareImpl(this), |
| 130 | #endif |
| 131 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
| 132 | VoENetEqStatsImpl(this), |
| 133 | #endif |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 134 | VoENetworkImpl(this), |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 135 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
| 136 | VoERTP_RTCPImpl(this), |
| 137 | #endif |
| 138 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
| 139 | VoEVideoSyncImpl(this), |
| 140 | #endif |
| 141 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
| 142 | VoEVolumeControlImpl(this), |
| 143 | #endif |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 144 | VoEBaseImpl(this), |
solenberg | 88499ec | 2016-09-07 07:34:41 -0700 | [diff] [blame] | 145 | _ref_count(0) {} |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 146 | ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); } |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 147 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 148 | int AddRef(); |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 149 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 150 | // This implements the Release() method for all the inherited interfaces. |
| 151 | int Release() override; |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 152 | |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 153 | // Backdoor to access a voe::Channel object without a channel ID. This is only |
| 154 | // to be used while refactoring the VoE API! |
kwiberg | b7f89d6 | 2016-02-17 10:04:18 -0800 | [diff] [blame] | 155 | virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id); |
solenberg | 1372508 | 2015-11-25 08:16:52 -0800 | [diff] [blame] | 156 | |
Fredrik Solenberg | 4f4ec0a | 2015-10-22 10:49:27 +0200 | [diff] [blame] | 157 | // This is *protected* so that FakeVoiceEngine can inherit from the class and |
| 158 | // manipulate the reference count. See: fake_voice_engine.h. |
| 159 | protected: |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 160 | Atomic32 _ref_count; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 161 | }; |
| 162 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 163 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 164 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 165 | #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |