andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 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 | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 14 | #include "webrtc/engine_configurations.h" |
| 15 | #include "webrtc/system_wrappers/interface/atomic32.h" |
| 16 | #include "webrtc/voice_engine/voe_base_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 17 | |
| 18 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 19 | #include "webrtc/voice_engine/voe_audio_processing_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 20 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 21 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 22 | #include "webrtc/voice_engine/voe_codec_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 23 | #endif |
| 24 | #ifdef WEBRTC_VOICE_ENGINE_DTMF_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 25 | #include "webrtc/voice_engine/voe_dtmf_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 26 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 27 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 28 | #include "webrtc/voice_engine/voe_external_media_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 29 | #endif |
| 30 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 31 | #include "webrtc/voice_engine/voe_file_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 32 | #endif |
| 33 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 34 | #include "webrtc/voice_engine/voe_hardware_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 35 | #endif |
| 36 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 37 | #include "webrtc/voice_engine/voe_neteq_stats_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 38 | #endif |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 39 | #include "webrtc/voice_engine/voe_network_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 40 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 41 | #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 42 | #endif |
| 43 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 44 | #include "webrtc/voice_engine/voe_video_sync_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 45 | #endif |
| 46 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
pbos@webrtc.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 47 | #include "webrtc/voice_engine/voe_volume_control_impl.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 48 | #endif |
| 49 | |
| 50 | namespace webrtc |
| 51 | { |
| 52 | |
| 53 | class VoiceEngineImpl : public voe::SharedData, // Must be the first base class |
tommi@webrtc.org | b9e5a3d | 2013-02-15 15:07:32 +0000 | [diff] [blame] | 54 | public VoiceEngine, |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 55 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
| 56 | public VoEAudioProcessingImpl, |
| 57 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 58 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
| 59 | public VoECodecImpl, |
| 60 | #endif |
| 61 | #ifdef WEBRTC_VOICE_ENGINE_DTMF_API |
| 62 | public VoEDtmfImpl, |
| 63 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 64 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
| 65 | public VoEExternalMediaImpl, |
| 66 | #endif |
| 67 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
| 68 | public VoEFileImpl, |
| 69 | #endif |
| 70 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
| 71 | public VoEHardwareImpl, |
| 72 | #endif |
| 73 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
| 74 | public VoENetEqStatsImpl, |
| 75 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 76 | public VoENetworkImpl, |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 77 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
| 78 | public VoERTP_RTCPImpl, |
| 79 | #endif |
| 80 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
| 81 | public VoEVideoSyncImpl, |
| 82 | #endif |
| 83 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
| 84 | public VoEVolumeControlImpl, |
| 85 | #endif |
| 86 | public VoEBaseImpl |
| 87 | { |
| 88 | public: |
minyue@webrtc.org | 4489c51 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 89 | VoiceEngineImpl(const Config* config, bool owns_config) : |
| 90 | SharedData(*config), |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 91 | #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
| 92 | VoEAudioProcessingImpl(this), |
| 93 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 94 | #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
| 95 | VoECodecImpl(this), |
| 96 | #endif |
| 97 | #ifdef WEBRTC_VOICE_ENGINE_DTMF_API |
| 98 | VoEDtmfImpl(this), |
| 99 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 100 | #ifdef WEBRTC_VOICE_ENGINE_EXTERNAL_MEDIA_API |
| 101 | VoEExternalMediaImpl(this), |
| 102 | #endif |
| 103 | #ifdef WEBRTC_VOICE_ENGINE_FILE_API |
| 104 | VoEFileImpl(this), |
| 105 | #endif |
| 106 | #ifdef WEBRTC_VOICE_ENGINE_HARDWARE_API |
| 107 | VoEHardwareImpl(this), |
| 108 | #endif |
| 109 | #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API |
| 110 | VoENetEqStatsImpl(this), |
| 111 | #endif |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 112 | VoENetworkImpl(this), |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 113 | #ifdef WEBRTC_VOICE_ENGINE_RTP_RTCP_API |
| 114 | VoERTP_RTCPImpl(this), |
| 115 | #endif |
| 116 | #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
| 117 | VoEVideoSyncImpl(this), |
| 118 | #endif |
| 119 | #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
| 120 | VoEVolumeControlImpl(this), |
| 121 | #endif |
| 122 | VoEBaseImpl(this), |
minyue@webrtc.org | 4489c51 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 123 | _ref_count(0), |
| 124 | own_config_(owns_config ? config : NULL) |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 125 | { |
| 126 | } |
| 127 | virtual ~VoiceEngineImpl() |
| 128 | { |
| 129 | assert(_ref_count.Value() == 0); |
| 130 | } |
| 131 | |
| 132 | int AddRef(); |
| 133 | |
| 134 | // This implements the Release() method for all the inherited interfaces. |
| 135 | virtual int Release(); |
| 136 | |
| 137 | private: |
| 138 | Atomic32 _ref_count; |
minyue@webrtc.org | 4489c51 | 2013-09-12 17:03:00 +0000 | [diff] [blame] | 139 | scoped_ptr<const Config> own_config_; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 140 | }; |
| 141 | |
pbos@webrtc.org | 3b89e10 | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 142 | } // namespace webrtc |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 143 | |
| 144 | #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |