OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <CoreAudio/AudioHardware.h> | 5 #include <CoreAudio/AudioHardware.h> |
6 | 6 |
7 #include "base/mac/mac_logging.h" | 7 #include "base/mac/mac_logging.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
11 #include "media/audio/mac/audio_input_mac.h" | 11 #include "media/audio/mac/audio_input_mac.h" |
12 #include "media/audio/mac/audio_low_latency_input_mac.h" | 12 #include "media/audio/mac/audio_low_latency_input_mac.h" |
13 #include "media/audio/mac/audio_low_latency_output_mac.h" | 13 #include "media/audio/mac/audio_low_latency_output_mac.h" |
14 #include "media/audio/mac/audio_manager_mac.h" | 14 #include "media/audio/mac/audio_manager_mac.h" |
15 #include "media/audio/mac/audio_output_mac.h" | 15 #include "media/audio/mac/audio_output_mac.h" |
16 #include "media/base/limits.h" | 16 #include "media/base/limits.h" |
17 | 17 |
18 namespace media { | |
19 | |
20 // Maximum number of output streams that can be open simultaneously. | 18 // Maximum number of output streams that can be open simultaneously. |
21 static const int kMaxOutputStreams = 50; | 19 static const int kMaxOutputStreams = 50; |
22 | 20 |
23 // By experiment the maximum number of audio streams allowed in Leopard | 21 // By experiment the maximum number of audio streams allowed in Leopard |
24 // is 18. But we put a slightly smaller number just to be safe. | 22 // is 18. But we put a slightly smaller number just to be safe. |
25 static const int kMaxOutputStreamsLeopard = 15; | 23 static const int kMaxOutputStreamsLeopard = 15; |
26 | 24 |
27 static bool HasAudioHardware(AudioObjectPropertySelector selector) { | 25 static bool HasAudioHardware(AudioObjectPropertySelector selector) { |
28 AudioDeviceID output_device_id = kAudioObjectUnknown; | 26 AudioDeviceID output_device_id = kAudioObjectUnknown; |
29 const AudioObjectPropertyAddress property_address = { | 27 const AudioObjectPropertyAddress property_address = { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 AudioInputStream* stream = NULL; | 286 AudioInputStream* stream = NULL; |
289 if (audio_device_id != kAudioObjectUnknown) | 287 if (audio_device_id != kAudioObjectUnknown) |
290 stream = new AUAudioInputStream(this, params, audio_device_id); | 288 stream = new AUAudioInputStream(this, params, audio_device_id); |
291 | 289 |
292 return stream; | 290 return stream; |
293 } | 291 } |
294 | 292 |
295 AudioManager* CreateAudioManager() { | 293 AudioManager* CreateAudioManager() { |
296 return new AudioManagerMac(); | 294 return new AudioManagerMac(); |
297 } | 295 } |
298 | |
299 } // namespace media | |
OLD | NEW |