Line data Source code
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 :
14 : #include <memory>
15 :
16 : #include "webrtc/system_wrappers/include/atomic32.h"
17 : #include "webrtc/typedefs.h"
18 : #include "webrtc/voice_engine/voe_base_impl.h"
19 : #include "webrtc/voice_engine/voe_audio_processing_impl.h"
20 : #include "webrtc/voice_engine/voe_codec_impl.h"
21 : #include "webrtc/voice_engine/voe_external_media_impl.h"
22 : #include "webrtc/voice_engine/voe_file_impl.h"
23 : #include "webrtc/voice_engine/voe_hardware_impl.h"
24 : #include "webrtc/voice_engine/voe_neteq_stats_impl.h"
25 : #include "webrtc/voice_engine/voe_network_impl.h"
26 : #include "webrtc/voice_engine/voe_rtp_rtcp_impl.h"
27 : #include "webrtc/voice_engine/voe_video_sync_impl.h"
28 : #include "webrtc/voice_engine/voe_volume_control_impl.h"
29 :
30 : namespace webrtc {
31 : namespace voe {
32 : class ChannelProxy;
33 : } // namespace voe
34 :
35 : class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
36 : public VoiceEngine,
37 : public VoEAudioProcessingImpl,
38 : public VoECodecImpl,
39 : public VoEExternalMediaImpl,
40 : public VoEFileImpl,
41 : public VoEHardwareImpl,
42 : public VoENetEqStatsImpl,
43 : public VoENetworkImpl,
44 : public VoERTP_RTCPImpl,
45 : public VoEVideoSyncImpl,
46 : public VoEVolumeControlImpl,
47 : public VoEBaseImpl {
48 : public:
49 0 : VoiceEngineImpl()
50 0 : : SharedData(),
51 : VoEAudioProcessingImpl(this),
52 : VoECodecImpl(this),
53 : VoEExternalMediaImpl(this),
54 : VoEFileImpl(this),
55 : VoEHardwareImpl(this),
56 : VoENetEqStatsImpl(this),
57 : VoENetworkImpl(this),
58 : VoERTP_RTCPImpl(this),
59 : VoEVideoSyncImpl(this),
60 : VoEVolumeControlImpl(this),
61 : VoEBaseImpl(this),
62 0 : _ref_count(0) {}
63 0 : ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }
64 :
65 : int AddRef();
66 :
67 : // This implements the Release() method for all the inherited interfaces.
68 : int Release() override;
69 :
70 : // Backdoor to access a voe::Channel object without a channel ID. This is only
71 : // to be used while refactoring the VoE API!
72 : virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id);
73 :
74 : // This is *protected* so that FakeVoiceEngine can inherit from the class and
75 : // manipulate the reference count. See: fake_voice_engine.h.
76 : protected:
77 : Atomic32 _ref_count;
78 : };
79 :
80 : } // namespace webrtc
81 :
82 : #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H
|