| 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/win/core_audio_util_win.h" | 5 #include "media/audio/win/core_audio_util_win.h" |
| 6 | 6 |
| 7 #include <devicetopology.h> | 7 #include <devicetopology.h> |
| 8 #include <dxdiag.h> | 8 #include <dxdiag.h> |
| 9 #include <functiondiscoverykeys_devpkey.h> | 9 #include <functiondiscoverykeys_devpkey.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 | 740 |
| 741 HRESULT CoreAudioUtil::GetPreferredAudioParameters(const std::string& device_id, | 741 HRESULT CoreAudioUtil::GetPreferredAudioParameters(const std::string& device_id, |
| 742 bool is_output_device, | 742 bool is_output_device, |
| 743 AudioParameters* params) { | 743 AudioParameters* params) { |
| 744 DCHECK(IsSupported()); | 744 DCHECK(IsSupported()); |
| 745 | 745 |
| 746 ScopedComPtr<IMMDevice> device; | 746 ScopedComPtr<IMMDevice> device; |
| 747 if (device_id == AudioDeviceDescription::kDefaultDeviceId) { | 747 if (device_id == AudioDeviceDescription::kDefaultDeviceId) { |
| 748 device = CoreAudioUtil::CreateDefaultDevice( | 748 device = CoreAudioUtil::CreateDefaultDevice( |
| 749 is_output_device ? eRender : eCapture, eConsole); | 749 is_output_device ? eRender : eCapture, eConsole); |
| 750 } else if (device_id == AudioDeviceDescription::kLoopbackInputDeviceId) { | 750 } else if (device_id == AudioDeviceDescription::kLoopbackInputDeviceId || |
| 751 device_id == AudioDeviceDescription::kLoopbackWithMuteDeviceId) { |
| 751 DCHECK(!is_output_device); | 752 DCHECK(!is_output_device); |
| 752 device = CoreAudioUtil::CreateDefaultDevice(eRender, eConsole); | 753 device = CoreAudioUtil::CreateDefaultDevice(eRender, eConsole); |
| 753 } else if (device_id == AudioDeviceDescription::kCommunicationsDeviceId) { | 754 } else if (device_id == AudioDeviceDescription::kCommunicationsDeviceId) { |
| 754 device = CoreAudioUtil::CreateDefaultDevice( | 755 device = CoreAudioUtil::CreateDefaultDevice( |
| 755 is_output_device ? eRender : eCapture, eCommunications); | 756 is_output_device ? eRender : eCapture, eCommunications); |
| 756 } else { | 757 } else { |
| 757 device = CreateDevice(device_id); | 758 device = CreateDevice(device_id); |
| 758 } | 759 } |
| 759 | 760 |
| 760 if (!device.get()) { | 761 if (!device.get()) { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 | 965 |
| 965 if (variant.type() == VT_BSTR && variant.ptr()->bstrVal) { | 966 if (variant.type() == VT_BSTR && variant.ptr()->bstrVal) { |
| 966 base::WideToUTF8(variant.ptr()->bstrVal, wcslen(variant.ptr()->bstrVal), | 967 base::WideToUTF8(variant.ptr()->bstrVal, wcslen(variant.ptr()->bstrVal), |
| 967 driver_version); | 968 driver_version); |
| 968 } | 969 } |
| 969 | 970 |
| 970 return true; | 971 return true; |
| 971 } | 972 } |
| 972 | 973 |
| 973 } // namespace media | 974 } // namespace media |
| OLD | NEW |