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 "media/audio/audio_io.h" | 5 #include "media/audio/audio_io.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <objbase.h> // This has to be before initguid.h | 8 #include <objbase.h> // This has to be before initguid.h |
9 #include <initguid.h> | 9 #include <initguid.h> |
10 #include <mmsystem.h> | 10 #include <mmsystem.h> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 enumeration_type_ = kWaveEnumeration; | 101 enumeration_type_ = kWaveEnumeration; |
102 } else { | 102 } else { |
103 // Use the MMDevice API for device enumeration if Vista or higher. | 103 // Use the MMDevice API for device enumeration if Vista or higher. |
104 enumeration_type_ = kMMDeviceEnumeration; | 104 enumeration_type_ = kMMDeviceEnumeration; |
105 } | 105 } |
106 | 106 |
107 SetMaxOutputStreamsAllowed(kMaxOutputStreams); | 107 SetMaxOutputStreamsAllowed(kMaxOutputStreams); |
108 } | 108 } |
109 | 109 |
110 AudioManagerWin::~AudioManagerWin() { | 110 AudioManagerWin::~AudioManagerWin() { |
| 111 Shutdown(); |
111 } | 112 } |
112 | 113 |
113 bool AudioManagerWin::HasAudioOutputDevices() { | 114 bool AudioManagerWin::HasAudioOutputDevices() { |
114 return (::waveOutGetNumDevs() != 0); | 115 return (::waveOutGetNumDevs() != 0); |
115 } | 116 } |
116 | 117 |
117 bool AudioManagerWin::HasAudioInputDevices() { | 118 bool AudioManagerWin::HasAudioInputDevices() { |
118 return (::waveInGetNumDevs() != 0); | 119 return (::waveInGetNumDevs() != 0); |
119 } | 120 } |
120 | 121 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 stream = new WASAPIAudioInputStream(this, params, device_id); | 294 stream = new WASAPIAudioInputStream(this, params, device_id); |
294 } | 295 } |
295 | 296 |
296 return stream; | 297 return stream; |
297 } | 298 } |
298 | 299 |
299 /// static | 300 /// static |
300 AudioManager* CreateAudioManager() { | 301 AudioManager* CreateAudioManager() { |
301 return new AudioManagerWin(); | 302 return new AudioManagerWin(); |
302 } | 303 } |
OLD | NEW |