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 |
18 // Maximum number of output streams that can be open simultaneously. | 20 // Maximum number of output streams that can be open simultaneously. |
19 static const int kMaxOutputStreams = 50; | 21 static const int kMaxOutputStreams = 50; |
20 | 22 |
21 // By experiment the maximum number of audio streams allowed in Leopard | 23 // By experiment the maximum number of audio streams allowed in Leopard |
22 // is 18. But we put a slightly smaller number just to be safe. | 24 // is 18. But we put a slightly smaller number just to be safe. |
23 static const int kMaxOutputStreamsLeopard = 15; | 25 static const int kMaxOutputStreamsLeopard = 15; |
24 | 26 |
25 static bool HasAudioHardware(AudioObjectPropertySelector selector) { | 27 static bool HasAudioHardware(AudioObjectPropertySelector selector) { |
26 AudioDeviceID output_device_id = kAudioObjectUnknown; | 28 AudioDeviceID output_device_id = kAudioObjectUnknown; |
27 const AudioObjectPropertyAddress property_address = { | 29 const AudioObjectPropertyAddress property_address = { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 AudioInputStream* stream = NULL; | 288 AudioInputStream* stream = NULL; |
287 if (audio_device_id != kAudioObjectUnknown) | 289 if (audio_device_id != kAudioObjectUnknown) |
288 stream = new AUAudioInputStream(this, params, audio_device_id); | 290 stream = new AUAudioInputStream(this, params, audio_device_id); |
289 | 291 |
290 return stream; | 292 return stream; |
291 } | 293 } |
292 | 294 |
293 AudioManager* CreateAudioManager() { | 295 AudioManager* CreateAudioManager() { |
294 return new AudioManagerMac(); | 296 return new AudioManagerMac(); |
295 } | 297 } |
| 298 |
| 299 } // namespace media |
OLD | NEW |