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_MAC_H | 11 #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_MAC_H |
12 #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_MAC_H | 12 #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_MAC_H |
13 | 13 |
14 #include "webrtc/base/scoped_ptr.h" | 14 #include "webrtc/base/scoped_ptr.h" |
15 #include "webrtc/base/thread_annotations.h" | 15 #include "webrtc/base/thread_annotations.h" |
16 #include "webrtc/modules/audio_device/audio_device_generic.h" | 16 #include "webrtc/modules/audio_device/audio_device_generic.h" |
17 #include "webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h" | 17 #include "webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h" |
18 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 18 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
19 | 19 |
20 #include <AudioToolbox/AudioConverter.h> | 20 #include <AudioToolbox/AudioConverter.h> |
21 #include <CoreAudio/CoreAudio.h> | 21 #include <CoreAudio/CoreAudio.h> |
22 #include <mach/semaphore.h> | 22 #include <mach/semaphore.h> |
23 | 23 |
24 struct PaUtilRingBuffer; | 24 struct PaUtilRingBuffer; |
25 | 25 |
26 namespace webrtc | 26 namespace webrtc |
27 { | 27 { |
28 class EventWrapper; | 28 class EventWrapper; |
29 class ThreadWrapper; | 29 class PlatformThread; |
30 | 30 |
31 const uint32_t N_REC_SAMPLES_PER_SEC = 48000; | 31 const uint32_t N_REC_SAMPLES_PER_SEC = 48000; |
32 const uint32_t N_PLAY_SAMPLES_PER_SEC = 48000; | 32 const uint32_t N_PLAY_SAMPLES_PER_SEC = 48000; |
33 | 33 |
34 const uint32_t N_REC_CHANNELS = 1; // default is mono recording | 34 const uint32_t N_REC_CHANNELS = 1; // default is mono recording |
35 const uint32_t N_PLAY_CHANNELS = 2; // default is stereo playout | 35 const uint32_t N_PLAY_CHANNELS = 2; // default is stereo playout |
36 const uint32_t N_DEVICE_CHANNELS = 64; | 36 const uint32_t N_DEVICE_CHANNELS = 64; |
37 | 37 |
38 const uint32_t ENGINE_REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC / 100); | 38 const uint32_t ENGINE_REC_BUF_SIZE_IN_SAMPLES = (N_REC_SAMPLES_PER_SEC / 100); |
39 const uint32_t ENGINE_PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC / 100); | 39 const uint32_t ENGINE_PLAY_BUF_SIZE_IN_SAMPLES = (N_PLAY_SAMPLES_PER_SEC / 100); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 bool KeyPressed(); | 276 bool KeyPressed(); |
277 | 277 |
278 AudioDeviceBuffer* _ptrAudioBuffer; | 278 AudioDeviceBuffer* _ptrAudioBuffer; |
279 | 279 |
280 CriticalSectionWrapper& _critSect; | 280 CriticalSectionWrapper& _critSect; |
281 | 281 |
282 EventWrapper& _stopEventRec; | 282 EventWrapper& _stopEventRec; |
283 EventWrapper& _stopEvent; | 283 EventWrapper& _stopEvent; |
284 | 284 |
285 // Only valid/running between calls to StartRecording and StopRecording. | 285 // Only valid/running between calls to StartRecording and StopRecording. |
286 rtc::scoped_ptr<ThreadWrapper> capture_worker_thread_; | 286 rtc::scoped_ptr<PlatformThread> capture_worker_thread_; |
287 | 287 |
288 // Only valid/running between calls to StartPlayout and StopPlayout. | 288 // Only valid/running between calls to StartPlayout and StopPlayout. |
289 rtc::scoped_ptr<ThreadWrapper> render_worker_thread_; | 289 rtc::scoped_ptr<PlatformThread> render_worker_thread_; |
290 | 290 |
291 int32_t _id; | 291 int32_t _id; |
292 | 292 |
293 AudioMixerManagerMac _mixerManager; | 293 AudioMixerManagerMac _mixerManager; |
294 | 294 |
295 uint16_t _inputDeviceIndex; | 295 uint16_t _inputDeviceIndex; |
296 uint16_t _outputDeviceIndex; | 296 uint16_t _outputDeviceIndex; |
297 AudioDeviceID _inputDeviceID; | 297 AudioDeviceID _inputDeviceID; |
298 AudioDeviceID _outputDeviceID; | 298 AudioDeviceID _outputDeviceID; |
299 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 | 299 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 int _renderBufSizeSamples; | 365 int _renderBufSizeSamples; |
366 | 366 |
367 // Typing detection | 367 // Typing detection |
368 // 0x5c is key "9", after that comes function keys. | 368 // 0x5c is key "9", after that comes function keys. |
369 bool prev_key_state_[0x5d]; | 369 bool prev_key_state_[0x5d]; |
370 }; | 370 }; |
371 | 371 |
372 } // namespace webrtc | 372 } // namespace webrtc |
373 | 373 |
374 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_MAC_AUDIO_DEVICE_MAC_H_ | 374 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_MAC_AUDIO_DEVICE_MAC_H_ |
OLD | NEW |