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 <memory> | 14 #include <memory> |
15 | 15 |
| 16 #include "webrtc/base/criticalsection.h" |
16 #include "webrtc/base/thread_annotations.h" | 17 #include "webrtc/base/thread_annotations.h" |
17 #include "webrtc/modules/audio_device/audio_device_generic.h" | 18 #include "webrtc/modules/audio_device/audio_device_generic.h" |
18 #include "webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h" | 19 #include "webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h" |
19 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 20 #include "webrtc/system_wrappers/include/event_wrapper.h" |
20 | 21 |
21 #include <AudioToolbox/AudioConverter.h> | 22 #include <AudioToolbox/AudioConverter.h> |
22 #include <CoreAudio/CoreAudio.h> | 23 #include <CoreAudio/CoreAudio.h> |
23 #include <mach/semaphore.h> | 24 #include <mach/semaphore.h> |
24 | 25 |
25 struct PaUtilRingBuffer; | 26 struct PaUtilRingBuffer; |
26 | 27 |
27 namespace rtc { | 28 namespace rtc { |
28 class PlatformThread; | 29 class PlatformThread; |
29 } // namespace rtc | 30 } // namespace rtc |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 277 |
277 static bool RunCapture(void*); | 278 static bool RunCapture(void*); |
278 static bool RunRender(void*); | 279 static bool RunRender(void*); |
279 bool CaptureWorkerThread(); | 280 bool CaptureWorkerThread(); |
280 bool RenderWorkerThread(); | 281 bool RenderWorkerThread(); |
281 | 282 |
282 bool KeyPressed(); | 283 bool KeyPressed(); |
283 | 284 |
284 AudioDeviceBuffer* _ptrAudioBuffer; | 285 AudioDeviceBuffer* _ptrAudioBuffer; |
285 | 286 |
286 CriticalSectionWrapper& _critSect; | 287 rtc::CriticalSection _critSect; |
287 | 288 |
288 EventWrapper& _stopEventRec; | 289 EventWrapper& _stopEventRec; |
289 EventWrapper& _stopEvent; | 290 EventWrapper& _stopEvent; |
290 | 291 |
291 // TODO(pbos): Replace with direct members, just start/stop, no need to | 292 // TODO(pbos): Replace with direct members, just start/stop, no need to |
292 // recreate the thread. | 293 // recreate the thread. |
293 // Only valid/running between calls to StartRecording and StopRecording. | 294 // Only valid/running between calls to StartRecording and StopRecording. |
294 std::unique_ptr<rtc::PlatformThread> capture_worker_thread_; | 295 std::unique_ptr<rtc::PlatformThread> capture_worker_thread_; |
295 | 296 |
296 // Only valid/running between calls to StartPlayout and StopPlayout. | 297 // Only valid/running between calls to StartPlayout and StopPlayout. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 // Typing detection | 376 // Typing detection |
376 // 0x5c is key "9", after that comes function keys. | 377 // 0x5c is key "9", after that comes function keys. |
377 bool prev_key_state_[0x5d]; | 378 bool prev_key_state_[0x5d]; |
378 | 379 |
379 int get_mic_volume_counter_ms_; | 380 int get_mic_volume_counter_ms_; |
380 }; | 381 }; |
381 | 382 |
382 } // namespace webrtc | 383 } // namespace webrtc |
383 | 384 |
384 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_MAC_AUDIO_DEVICE_MAC_H_ | 385 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_MAC_AUDIO_DEVICE_MAC_H_ |
OLD | NEW |