Chromium Code Reviews| 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 <audioclient.h> | 7 #include <audioclient.h> |
| 8 #include <devicetopology.h> | 8 #include <devicetopology.h> |
| 9 #include <functiondiscoverykeys_devpkey.h> | 9 #include <functiondiscoverykeys_devpkey.h> |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 DVLOG(1) << "Forcing usage of Windows WaveXxx APIs"; | 163 DVLOG(1) << "Forcing usage of Windows WaveXxx APIs"; |
| 164 return false; | 164 return false; |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Microsoft does not plan to make the Core Audio APIs available for use | 167 // Microsoft does not plan to make the Core Audio APIs available for use |
| 168 // with earlier versions of Windows, including Microsoft Windows Server 2003, | 168 // with earlier versions of Windows, including Microsoft Windows Server 2003, |
| 169 // Windows XP, Windows Millennium Edition, Windows 2000, and Windows 98. | 169 // Windows XP, Windows Millennium Edition, Windows 2000, and Windows 98. |
| 170 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 170 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
| 171 return false; | 171 return false; |
| 172 | 172 |
| 173 // Don't use CoreAudio when a remote desktop session is present; several users | |
| 174 // report only WaveAudio working for them and crash reports show hangs when | |
| 175 // calling into the OS for CoreAudio API calls. See http://crbug.com/422522 | |
| 176 // and http://crbug.com/180591. | |
| 177 // | |
| 178 // Note: It's possible that a user will connect a remote desktop session after | |
| 179 // this check has been done. In practice this shouldn't be the dominant case | |
| 180 // though and CoreAudio does work for many users. | |
| 181 if (GetSystemMetrics(SM_REMOTESESSION)) | |
|
henrika (OOO until Aug 14)
2015/04/05 14:41:08
This is the only detection method I could find as
| |
| 182 return false; | |
| 183 | |
| 173 // The audio core APIs are implemented in the Mmdevapi.dll and Audioses.dll | 184 // The audio core APIs are implemented in the Mmdevapi.dll and Audioses.dll |
| 174 // system components. | 185 // system components. |
| 175 // Dependency Walker shows that it is enough to verify possibility to load | 186 // Dependency Walker shows that it is enough to verify possibility to load |
| 176 // the Audioses DLL since it depends on Mmdevapi.dll. | 187 // the Audioses DLL since it depends on Mmdevapi.dll. |
| 177 // See http://crbug.com/166397 why this extra step is required to guarantee | 188 // See http://crbug.com/166397 why this extra step is required to guarantee |
| 178 // Core Audio support. | 189 // Core Audio support. |
| 179 static bool g_audioses_dll_available = LoadAudiosesDll(); | 190 static bool g_audioses_dll_available = LoadAudiosesDll(); |
| 180 if (!g_audioses_dll_available) | 191 if (!g_audioses_dll_available) |
| 181 return false; | 192 return false; |
| 182 | 193 |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 848 return false; | 859 return false; |
| 849 | 860 |
| 850 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to | 861 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to |
| 851 // explicitly write silence data to the rendering buffer. | 862 // explicitly write silence data to the rendering buffer. |
| 852 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; | 863 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; |
| 853 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, | 864 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, |
| 854 AUDCLNT_BUFFERFLAGS_SILENT)); | 865 AUDCLNT_BUFFERFLAGS_SILENT)); |
| 855 } | 866 } |
| 856 | 867 |
| 857 } // namespace media | 868 } // namespace media |
| OLD | NEW |