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