| 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 <objbase.h> |
| 10 #include <stddef.h> | 11 #include <stddef.h> |
| 11 | 12 |
| 12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/win/scoped_co_mem.h" | 18 #include "base/win/scoped_co_mem.h" |
| 18 #include "base/win/scoped_handle.h" | 19 #include "base/win/scoped_handle.h" |
| 19 #include "base/win/scoped_propvariant.h" | 20 #include "base/win/scoped_propvariant.h" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 DVLOG(2) << "stream latency: " | 823 DVLOG(2) << "stream latency: " |
| 823 << RefererenceTimeToTimeDelta(latency).InMillisecondsF() << " [ms]"; | 824 << RefererenceTimeToTimeDelta(latency).InMillisecondsF() << " [ms]"; |
| 824 return hr; | 825 return hr; |
| 825 } | 826 } |
| 826 | 827 |
| 827 ScopedComPtr<IAudioRenderClient> CoreAudioUtil::CreateRenderClient( | 828 ScopedComPtr<IAudioRenderClient> CoreAudioUtil::CreateRenderClient( |
| 828 IAudioClient* client) { | 829 IAudioClient* client) { |
| 829 // Get access to the IAudioRenderClient interface. This interface | 830 // Get access to the IAudioRenderClient interface. This interface |
| 830 // enables us to write output data to a rendering endpoint buffer. | 831 // enables us to write output data to a rendering endpoint buffer. |
| 831 ScopedComPtr<IAudioRenderClient> audio_render_client; | 832 ScopedComPtr<IAudioRenderClient> audio_render_client; |
| 832 HRESULT hr = client->GetService(__uuidof(IAudioRenderClient), | 833 HRESULT hr = client->GetService(IID_PPV_ARGS(&audio_render_client)); |
| 833 audio_render_client.ReceiveVoid()); | |
| 834 if (FAILED(hr)) { | 834 if (FAILED(hr)) { |
| 835 DVLOG(1) << "IAudioClient::GetService: " << std::hex << hr; | 835 DVLOG(1) << "IAudioClient::GetService: " << std::hex << hr; |
| 836 return ScopedComPtr<IAudioRenderClient>(); | 836 return ScopedComPtr<IAudioRenderClient>(); |
| 837 } | 837 } |
| 838 return audio_render_client; | 838 return audio_render_client; |
| 839 } | 839 } |
| 840 | 840 |
| 841 ScopedComPtr<IAudioCaptureClient> CoreAudioUtil::CreateCaptureClient( | 841 ScopedComPtr<IAudioCaptureClient> CoreAudioUtil::CreateCaptureClient( |
| 842 IAudioClient* client) { | 842 IAudioClient* client) { |
| 843 // Get access to the IAudioCaptureClient interface. This interface | 843 // Get access to the IAudioCaptureClient interface. This interface |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 | 920 |
| 921 if (variant.type() == VT_BSTR && variant.ptr()->bstrVal) { | 921 if (variant.type() == VT_BSTR && variant.ptr()->bstrVal) { |
| 922 base::WideToUTF8(variant.ptr()->bstrVal, wcslen(variant.ptr()->bstrVal), | 922 base::WideToUTF8(variant.ptr()->bstrVal, wcslen(variant.ptr()->bstrVal), |
| 923 driver_version); | 923 driver_version); |
| 924 } | 924 } |
| 925 | 925 |
| 926 return true; | 926 return true; |
| 927 } | 927 } |
| 928 | 928 |
| 929 } // namespace media | 929 } // namespace media |
| OLD | NEW |