| 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 | 10 |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 ScopedComPtr<IAudioClient> client( | 790 ScopedComPtr<IAudioClient> client( |
| 791 CreateClient(device_id, data_flow, eConsole)); | 791 CreateClient(device_id, data_flow, eConsole)); |
| 792 | 792 |
| 793 WAVEFORMATPCMEX format = {}; | 793 WAVEFORMATPCMEX format = {}; |
| 794 if (!client.get() || FAILED(GetSharedModeMixFormat(client.get(), &format))) | 794 if (!client.get() || FAILED(GetSharedModeMixFormat(client.get(), &format))) |
| 795 return 0; | 795 return 0; |
| 796 | 796 |
| 797 return static_cast<ChannelConfig>(format.dwChannelMask); | 797 return static_cast<ChannelConfig>(format.dwChannelMask); |
| 798 } | 798 } |
| 799 | 799 |
| 800 HRESULT CoreAudioUtil::SharedModeInitialize( | 800 HRESULT CoreAudioUtil::SharedModeInitialize(IAudioClient* client, |
| 801 IAudioClient* client, const WAVEFORMATPCMEX* format, HANDLE event_handle, | 801 const WAVEFORMATPCMEX* format, |
| 802 uint32* endpoint_buffer_size, const GUID* session_guid) { | 802 HANDLE event_handle, |
| 803 uint32_t* endpoint_buffer_size, |
| 804 const GUID* session_guid) { |
| 803 DCHECK(IsSupported()); | 805 DCHECK(IsSupported()); |
| 804 | 806 |
| 805 // Use default flags (i.e, dont set AUDCLNT_STREAMFLAGS_NOPERSIST) to | 807 // Use default flags (i.e, dont set AUDCLNT_STREAMFLAGS_NOPERSIST) to |
| 806 // ensure that the volume level and muting state for a rendering session | 808 // ensure that the volume level and muting state for a rendering session |
| 807 // are persistent across system restarts. The volume level and muting | 809 // are persistent across system restarts. The volume level and muting |
| 808 // state for a capture session are never persistent. | 810 // state for a capture session are never persistent. |
| 809 DWORD stream_flags = 0; | 811 DWORD stream_flags = 0; |
| 810 | 812 |
| 811 // Enable event-driven streaming if a valid event handle is provided. | 813 // Enable event-driven streaming if a valid event handle is provided. |
| 812 // After the stream starts, the audio engine will signal the event handle | 814 // After the stream starts, the audio engine will signal the event handle |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 961 |
| 960 if (variant.type() == VT_BSTR && variant.ptr()->bstrVal) { | 962 if (variant.type() == VT_BSTR && variant.ptr()->bstrVal) { |
| 961 base::WideToUTF8(variant.ptr()->bstrVal, wcslen(variant.ptr()->bstrVal), | 963 base::WideToUTF8(variant.ptr()->bstrVal, wcslen(variant.ptr()->bstrVal), |
| 962 driver_version); | 964 driver_version); |
| 963 } | 965 } |
| 964 | 966 |
| 965 return true; | 967 return true; |
| 966 } | 968 } |
| 967 | 969 |
| 968 } // namespace media | 970 } // namespace media |
| OLD | NEW |