| 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_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H | 11 #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H |
| 12 #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H | 12 #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H |
| 13 | 13 |
| 14 #if defined(WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE) | 14 #if defined(WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE) |
| 15 | 15 |
| 16 #include <memory> | 16 #include <memory> |
| 17 | 17 |
| 18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
| 19 #include "webrtc/base/criticalsection.h" |
| 19 #include "webrtc/modules/audio_device/audio_device_buffer.h" | 20 #include "webrtc/modules/audio_device/audio_device_buffer.h" |
| 20 #include "webrtc/modules/audio_device/include/audio_device.h" | 21 #include "webrtc/modules/audio_device/include/audio_device.h" |
| 21 | 22 |
| 22 namespace webrtc { | 23 namespace webrtc { |
| 23 | 24 |
| 24 class AudioDeviceGeneric; | 25 class AudioDeviceGeneric; |
| 25 class AudioManager; | 26 class AudioManager; |
| 26 class CriticalSectionWrapper; | |
| 27 | 27 |
| 28 class AudioDeviceModuleImpl : public AudioDeviceModule { | 28 class AudioDeviceModuleImpl : public AudioDeviceModule { |
| 29 public: | 29 public: |
| 30 enum PlatformType { | 30 enum PlatformType { |
| 31 kPlatformNotSupported = 0, | 31 kPlatformNotSupported = 0, |
| 32 kPlatformWin32 = 1, | 32 kPlatformWin32 = 1, |
| 33 kPlatformWinCe = 2, | 33 kPlatformWinCe = 2, |
| 34 kPlatformLinux = 3, | 34 kPlatformLinux = 3, |
| 35 kPlatformMac = 4, | 35 kPlatformMac = 4, |
| 36 kPlatformAndroid = 5, | 36 kPlatformAndroid = 5, |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 AudioManager* GetAndroidAudioManagerForTest() { | 196 AudioManager* GetAndroidAudioManagerForTest() { |
| 197 return _audioManagerAndroid.get(); | 197 return _audioManagerAndroid.get(); |
| 198 } | 198 } |
| 199 #endif | 199 #endif |
| 200 AudioDeviceBuffer* GetAudioDeviceBuffer() { return &_audioDeviceBuffer; } | 200 AudioDeviceBuffer* GetAudioDeviceBuffer() { return &_audioDeviceBuffer; } |
| 201 | 201 |
| 202 private: | 202 private: |
| 203 PlatformType Platform() const; | 203 PlatformType Platform() const; |
| 204 AudioLayer PlatformAudioLayer() const; | 204 AudioLayer PlatformAudioLayer() const; |
| 205 | 205 |
| 206 CriticalSectionWrapper& _critSect; | 206 rtc::CriticalSection _critSect; |
| 207 CriticalSectionWrapper& _critSectEventCb; | 207 rtc::CriticalSection _critSectEventCb; |
| 208 CriticalSectionWrapper& _critSectAudioCb; | 208 rtc::CriticalSection _critSectAudioCb; |
| 209 | 209 |
| 210 AudioDeviceObserver* _ptrCbAudioDeviceObserver; | 210 AudioDeviceObserver* _ptrCbAudioDeviceObserver; |
| 211 | 211 |
| 212 AudioDeviceGeneric* _ptrAudioDevice; | 212 AudioDeviceGeneric* _ptrAudioDevice; |
| 213 | 213 |
| 214 AudioDeviceBuffer _audioDeviceBuffer; | 214 AudioDeviceBuffer _audioDeviceBuffer; |
| 215 #if defined(WEBRTC_ANDROID) | 215 #if defined(WEBRTC_ANDROID) |
| 216 std::unique_ptr<AudioManager> _audioManagerAndroid; | 216 std::unique_ptr<AudioManager> _audioManagerAndroid; |
| 217 #endif | 217 #endif |
| 218 int32_t _id; | 218 int32_t _id; |
| 219 AudioLayer _platformAudioLayer; | 219 AudioLayer _platformAudioLayer; |
| 220 int64_t _lastProcessTime; | 220 int64_t _lastProcessTime; |
| 221 PlatformType _platformType; | 221 PlatformType _platformType; |
| 222 bool _initialized; | 222 bool _initialized; |
| 223 mutable ErrorCode _lastError; | 223 mutable ErrorCode _lastError; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 } // namespace webrtc | 226 } // namespace webrtc |
| 227 | 227 |
| 228 #endif // defined(WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE) | 228 #endif // defined(WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE) |
| 229 | 229 |
| 230 #endif // WEBRTC_MODULES_INTERFACE_AUDIO_DEVICE_IMPL_H_ | 230 #endif // WEBRTC_MODULES_INTERFACE_AUDIO_DEVICE_IMPL_H_ |
| OLD | NEW |