OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H | 11 #ifndef WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |
12 #define WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H | 12 #define WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |
13 | 13 |
| 14 #include "webrtc/base/atomicops.h" |
14 #include "webrtc/engine_configurations.h" | 15 #include "webrtc/engine_configurations.h" |
15 #include "webrtc/system_wrappers/interface/atomic32.h" | |
16 #include "webrtc/voice_engine/voe_base_impl.h" | 16 #include "webrtc/voice_engine/voe_base_impl.h" |
17 | 17 |
18 #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API | 18 #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API |
19 #include "webrtc/voice_engine/voe_audio_processing_impl.h" | 19 #include "webrtc/voice_engine/voe_audio_processing_impl.h" |
20 #endif | 20 #endif |
21 #ifdef WEBRTC_VOICE_ENGINE_CODEC_API | 21 #ifdef WEBRTC_VOICE_ENGINE_CODEC_API |
22 #include "webrtc/voice_engine/voe_codec_impl.h" | 22 #include "webrtc/voice_engine/voe_codec_impl.h" |
23 #endif | 23 #endif |
24 #ifdef WEBRTC_VOICE_ENGINE_DTMF_API | 24 #ifdef WEBRTC_VOICE_ENGINE_DTMF_API |
25 #include "webrtc/voice_engine/voe_dtmf_impl.h" | 25 #include "webrtc/voice_engine/voe_dtmf_impl.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API | 114 #ifdef WEBRTC_VOICE_ENGINE_VIDEO_SYNC_API |
115 VoEVideoSyncImpl(this), | 115 VoEVideoSyncImpl(this), |
116 #endif | 116 #endif |
117 #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API | 117 #ifdef WEBRTC_VOICE_ENGINE_VOLUME_CONTROL_API |
118 VoEVolumeControlImpl(this), | 118 VoEVolumeControlImpl(this), |
119 #endif | 119 #endif |
120 VoEBaseImpl(this), | 120 VoEBaseImpl(this), |
121 _ref_count(0), | 121 _ref_count(0), |
122 own_config_(owns_config ? config : NULL) { | 122 own_config_(owns_config ? config : NULL) { |
123 } | 123 } |
124 ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); } | 124 ~VoiceEngineImpl() override { |
| 125 assert(rtc::AtomicOps::AcquireLoad(&_ref_count) == 0); |
| 126 } |
125 | 127 |
126 int AddRef(); | 128 int AddRef(); |
127 | 129 |
128 // This implements the Release() method for all the inherited interfaces. | 130 // This implements the Release() method for all the inherited interfaces. |
129 int Release() override; | 131 int Release() override; |
130 | 132 |
131 private: | 133 private: |
132 Atomic32 _ref_count; | 134 volatile int _ref_count; |
133 rtc::scoped_ptr<const Config> own_config_; | 135 rtc::scoped_ptr<const Config> own_config_; |
134 }; | 136 }; |
135 | 137 |
136 } // namespace webrtc | 138 } // namespace webrtc |
137 | 139 |
138 #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H | 140 #endif // WEBRTC_VOICE_ENGINE_VOICE_ENGINE_IMPL_H |
OLD | NEW |