blob: b0c821eb5d459b6ecff742fda6320ef524abba47 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tommi@webrtc.org851becd2012-04-04 14:57:19 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
kwibergb7f89d62016-02-17 10:04:18 -080014#include <memory>
15
Henrik Kjellander98f53512015-10-28 18:17:40 +010016#include "webrtc/system_wrappers/include/atomic32.h"
mflodman7056be92016-10-07 07:07:28 +020017#include "webrtc/voice_engine_configurations.h"
henrik.lundine066b302016-12-02 02:30:15 -080018#include "webrtc/voice_engine/voe_base_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000019#include "webrtc/voice_engine/voe_audio_processing_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000020#include "webrtc/voice_engine/voe_codec_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000021#include "webrtc/voice_engine/voe_external_media_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000022#include "webrtc/voice_engine/voe_file_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000023#include "webrtc/voice_engine/voe_hardware_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000024#include "webrtc/voice_engine/voe_neteq_stats_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000025#include "webrtc/voice_engine/voe_network_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000026#include "webrtc/voice_engine/voe_rtp_rtcp_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000027#include "webrtc/voice_engine/voe_video_sync_impl.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000028#include "webrtc/voice_engine/voe_volume_control_impl.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000029
Jelena Marusic0d266052015-05-04 14:15:32 +020030namespace webrtc {
solenberg13725082015-11-25 08:16:52 -080031namespace voe {
32class ChannelProxy;
33} // namespace voe
niklase@google.com470e71d2011-07-07 08:21:25 +000034
tommi@webrtc.org851becd2012-04-04 14:57:19 +000035class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
tommi@webrtc.org0989fb72013-02-15 15:07:32 +000036 public VoiceEngine,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000037 public VoEAudioProcessingImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000038 public VoECodecImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000039 public VoEExternalMediaImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000040 public VoEFileImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000041 public VoEHardwareImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000042 public VoENetEqStatsImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000043 public VoENetworkImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000044 public VoERTP_RTCPImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000045 public VoEVideoSyncImpl,
tommi@webrtc.org851becd2012-04-04 14:57:19 +000046 public VoEVolumeControlImpl,
Jelena Marusic0d266052015-05-04 14:15:32 +020047 public VoEBaseImpl {
48 public:
solenberg88499ec2016-09-07 07:34:41 -070049 VoiceEngineImpl()
50 : SharedData(),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000051 VoEAudioProcessingImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000052 VoECodecImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000053 VoEExternalMediaImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000054 VoEFileImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000055 VoEHardwareImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000056 VoENetEqStatsImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000057 VoENetworkImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000058 VoERTP_RTCPImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000059 VoEVideoSyncImpl(this),
tommi@webrtc.org851becd2012-04-04 14:57:19 +000060 VoEVolumeControlImpl(this),
tommi@webrtc.orga990e122012-04-26 15:28:22 +000061 VoEBaseImpl(this),
solenberg88499ec2016-09-07 07:34:41 -070062 _ref_count(0) {}
Jelena Marusic0d266052015-05-04 14:15:32 +020063 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }
tommi@webrtc.orga990e122012-04-26 15:28:22 +000064
Jelena Marusic0d266052015-05-04 14:15:32 +020065 int AddRef();
tommi@webrtc.orga990e122012-04-26 15:28:22 +000066
Jelena Marusic0d266052015-05-04 14:15:32 +020067 // This implements the Release() method for all the inherited interfaces.
68 int Release() override;
tommi@webrtc.orga990e122012-04-26 15:28:22 +000069
solenberg13725082015-11-25 08:16:52 -080070 // Backdoor to access a voe::Channel object without a channel ID. This is only
71 // to be used while refactoring the VoE API!
kwibergb7f89d62016-02-17 10:04:18 -080072 virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id);
solenberg13725082015-11-25 08:16:52 -080073
Fredrik Solenberg4f4ec0a2015-10-22 10:49:27 +020074 // This is *protected* so that FakeVoiceEngine can inherit from the class and
75 // manipulate the reference count. See: fake_voice_engine.h.
76 protected:
Jelena Marusic0d266052015-05-04 14:15:32 +020077 Atomic32 _ref_count;
niklase@google.com470e71d2011-07-07 08:21:25 +000078};
79
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000080} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000081
Jelena Marusic0d266052015-05-04 14:15:32 +020082#endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H