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