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 | |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 14 | #include "webrtc/engine_configurations.h" |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 15 | #include "webrtc/system_wrappers/include/atomic32.h" |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 16 | #include "webrtc/voice_engine/voe_base_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | |
| 18 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 19 | #include "webrtc/voice_engine/voe_audio_processing_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 21 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 22 | #include "webrtc/voice_engine/voe_codec_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 23 | #endif |
| 24 | #ifdef WEBRTC_VOICE_ENGINE_DTMF_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 25 | #include "webrtc/voice_engine/voe_dtmf_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 28 | #include "webrtc/voice_engine/voe_external_media_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | #endif |
| 30 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 31 | #include "webrtc/voice_engine/voe_file_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 32 | #endif |
| 33 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 34 | #include "webrtc/voice_engine/voe_hardware_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 35 | #endif |
| 36 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 37 | #include "webrtc/voice_engine/voe_neteq_stats_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 38 | #endif |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 39 | #include "webrtc/voice_engine/voe_network_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 40 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 41 | #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | #endif |
| 43 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 44 | #include "webrtc/voice_engine/voe_video_sync_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 45 | #endif |
| 46 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
pbos@webrtc.org | 956aa7e | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 47 | #include "webrtc/voice_engine/voe_volume_control_impl.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 48 | #endif |
| 49 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 50 | namespace webrtc { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 52 | class VoiceEngineImpl : public voe::SharedData, // Must be the first base class |
tommi@webrtc.org | 0989fb7 | 2013-02-15 15:07:32 +0000 | [diff] [blame] | 53 | public VoiceEngine, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 55 | public VoEAudioProcessingImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 57 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 58 | public VoECodecImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 59 | #endif |
| 60 | #ifdef WEBRTC_VOICE_ENGINE_DTMF_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 61 | public VoEDtmfImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 62 | #endif |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 63 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 64 | public VoEExternalMediaImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 65 | #endif |
| 66 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 67 | public VoEFileImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 68 | #endif |
| 69 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 70 | public VoEHardwareImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 71 | #endif |
| 72 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 73 | public VoENetEqStatsImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | #endif |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 75 | public VoENetworkImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 76 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 77 | public VoERTP_RTCPImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 78 | #endif |
| 79 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 80 | public VoEVideoSyncImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 81 | #endif |
| 82 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 83 | public VoEVolumeControlImpl, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 84 | #endif |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 85 | public VoEBaseImpl { |
| 86 | public: |
| 87 | VoiceEngineImpl(const Config* config, bool owns_config) |
| 88 | : SharedData(*config), |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 89 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
| 90 | VoEAudioProcessingImpl(this), |
tommi@webrtc.org | 9ff87db | 2012-01-19 15:05:36 +0000 | [diff] [blame] | 91 | #endif |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 92 | #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.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 98 | #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.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 110 | VoENetworkImpl(this), |
tommi@webrtc.org | 851becd | 2012-04-04 14:57:19 +0000 | [diff] [blame] | 111 | #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.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 120 | VoEBaseImpl(this), |
minyue@webrtc.org | e509f94 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 121 | _ref_count(0), |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 122 | own_config_(owns_config ? config : NULL) { |
| 123 | } |
| 124 | ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); } |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 125 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 126 | int AddRef(); |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 127 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 128 | // This implements the Release() method for all the inherited interfaces. |
| 129 | int Release() override; |
tommi@webrtc.org | a990e12 | 2012-04-26 15:28:22 +0000 | [diff] [blame] | 130 | |
Fredrik Solenberg | 4f4ec0a | 2015-10-22 10:49:27 +0200 | [diff] [blame] | 131 | // This is *protected* so that FakeVoiceEngine can inherit from the class and |
| 132 | // manipulate the reference count. See: fake_voice_engine.h. |
| 133 | protected: |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 134 | Atomic32 _ref_count; |
Fredrik Solenberg | 4f4ec0a | 2015-10-22 10:49:27 +0200 | [diff] [blame] | 135 | private: |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 136 | rtc::scoped_ptr<const Config> own_config_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 137 | }; |
| 138 | |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 139 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 140 | |
Jelena Marusic | 0d26605 | 2015-05-04 14:15:32 +0200 | [diff] [blame] | 141 | #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |