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" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // special hard limit only for Leopard. | 214 // special hard limit only for Leopard. |
215 // See bug: http://crbug.com/30242 | 215 // See bug: http://crbug.com/30242 |
216 // In OS other than OSX Leopard, the number of audio streams | 216 // In OS other than OSX Leopard, the number of audio streams |
217 // allowed is a lot more. | 217 // allowed is a lot more. |
218 int max_output_stream = base::mac::IsOSLeopardOrEarlier() ? | 218 int max_output_stream = base::mac::IsOSLeopardOrEarlier() ? |
219 kMaxOutputStreamsLeopard : kMaxOutputStreams; | 219 kMaxOutputStreamsLeopard : kMaxOutputStreams; |
220 SetMaxOutputStreamsAllowed(max_output_stream); | 220 SetMaxOutputStreamsAllowed(max_output_stream); |
221 } | 221 } |
222 | 222 |
223 AudioManagerMac::~AudioManagerMac() { | 223 AudioManagerMac::~AudioManagerMac() { |
| 224 Shutdown(); |
224 } | 225 } |
225 | 226 |
226 bool AudioManagerMac::HasAudioOutputDevices() { | 227 bool AudioManagerMac::HasAudioOutputDevices() { |
227 return HasAudioHardware(kAudioHardwarePropertyDefaultOutputDevice); | 228 return HasAudioHardware(kAudioHardwarePropertyDefaultOutputDevice); |
228 } | 229 } |
229 | 230 |
230 bool AudioManagerMac::HasAudioInputDevices() { | 231 bool AudioManagerMac::HasAudioInputDevices() { |
231 return HasAudioHardware(kAudioHardwarePropertyDefaultInputDevice); | 232 return HasAudioHardware(kAudioHardwarePropertyDefaultInputDevice); |
232 } | 233 } |
233 | 234 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 AudioInputStream* stream = NULL; | 286 AudioInputStream* stream = NULL; |
286 if (audio_device_id != kAudioObjectUnknown) | 287 if (audio_device_id != kAudioObjectUnknown) |
287 stream = new AUAudioInputStream(this, params, audio_device_id); | 288 stream = new AUAudioInputStream(this, params, audio_device_id); |
288 | 289 |
289 return stream; | 290 return stream; |
290 } | 291 } |
291 | 292 |
292 AudioManager* CreateAudioManager() { | 293 AudioManager* CreateAudioManager() { |
293 return new AudioManagerMac(); | 294 return new AudioManagerMac(); |
294 } | 295 } |
OLD | NEW |