| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 string16 AudioManagerWin::GetAudioInputDeviceModel() { | 170 string16 AudioManagerWin::GetAudioInputDeviceModel() { |
| 171 // Get the default audio capture device and its device interface name. | 171 // Get the default audio capture device and its device interface name. |
| 172 DWORD device_id = 0; | 172 DWORD device_id = 0; |
| 173 waveInMessage(reinterpret_cast<HWAVEIN>(WAVE_MAPPER), | 173 waveInMessage(reinterpret_cast<HWAVEIN>(WAVE_MAPPER), |
| 174 DRVM_MAPPER_PREFERRED_GET, | 174 DRVM_MAPPER_PREFERRED_GET, |
| 175 reinterpret_cast<DWORD_PTR>(&device_id), NULL); | 175 reinterpret_cast<DWORD_PTR>(&device_id), NULL); |
| 176 ULONG device_interface_name_size = 0; | 176 ULONG device_interface_name_size = 0; |
| 177 waveInMessage(reinterpret_cast<HWAVEIN>(device_id), | 177 waveInMessage(reinterpret_cast<HWAVEIN>(device_id), |
| 178 DRV_QUERYDEVICEINTERFACESIZE, | 178 DRV_QUERYDEVICEINTERFACESIZE, |
| 179 reinterpret_cast<DWORD_PTR>(&device_interface_name_size), 0); | 179 reinterpret_cast<DWORD_PTR>(&device_interface_name_size), 0); |
| 180 if (device_interface_name_size == 0) // No audio capture device? |
| 181 return string16(); |
| 182 |
| 180 string16 device_interface_name; | 183 string16 device_interface_name; |
| 181 string16::value_type* name_ptr = WriteInto(&device_interface_name, | 184 string16::value_type* name_ptr = WriteInto(&device_interface_name, |
| 182 device_interface_name_size / sizeof(string16::value_type)); | 185 device_interface_name_size / sizeof(string16::value_type)); |
| 183 waveInMessage(reinterpret_cast<HWAVEIN>(device_id), | 186 waveInMessage(reinterpret_cast<HWAVEIN>(device_id), |
| 184 DRV_QUERYDEVICEINTERFACE, | 187 DRV_QUERYDEVICEINTERFACE, |
| 185 reinterpret_cast<DWORD_PTR>(name_ptr), | 188 reinterpret_cast<DWORD_PTR>(name_ptr), |
| 186 static_cast<DWORD_PTR>(device_interface_name_size)); | 189 static_cast<DWORD_PTR>(device_interface_name_size)); |
| 187 | 190 |
| 188 // Enumerate all audio devices and find the one matching the above device | 191 // Enumerate all audio devices and find the one matching the above device |
| 189 // interface name. | 192 // interface name. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 return GetDeviceAndDriverInfo(device_info, &device_data); | 226 return GetDeviceAndDriverInfo(device_info, &device_data); |
| 224 } | 227 } |
| 225 | 228 |
| 226 return string16(); | 229 return string16(); |
| 227 } | 230 } |
| 228 | 231 |
| 229 // static | 232 // static |
| 230 AudioManager* AudioManager::CreateAudioManager() { | 233 AudioManager* AudioManager::CreateAudioManager() { |
| 231 return new AudioManagerWin(); | 234 return new AudioManagerWin(); |
| 232 } | 235 } |
| OLD | NEW |