| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 return AUDCLNT_E_ENDPOINT_CREATE_FAILED; | 691 return AUDCLNT_E_ENDPOINT_CREATE_FAILED; |
| 692 } | 692 } |
| 693 | 693 |
| 694 HRESULT hr = GetPreferredAudioParameters(client, params); | 694 HRESULT hr = GetPreferredAudioParameters(client, params); |
| 695 if (FAILED(hr)) | 695 if (FAILED(hr)) |
| 696 return hr; | 696 return hr; |
| 697 | 697 |
| 698 if (role == eCommunications) { | 698 if (role == eCommunications) { |
| 699 // Raise the 'DUCKING' flag for default communication devices. | 699 // Raise the 'DUCKING' flag for default communication devices. |
| 700 *params = AudioParameters(params->format(), params->channel_layout(), | 700 *params = AudioParameters(params->format(), params->channel_layout(), |
| 701 params->channels(), params->sample_rate(), params->bits_per_sample(), | 701 params->channels(), params->input_channels(), params->sample_rate(), |
| 702 params->frames_per_buffer(), | 702 params->bits_per_sample(), params->frames_per_buffer(), |
| 703 params->effects() | AudioParameters::DUCKING); | 703 params->effects() | AudioParameters::DUCKING); |
| 704 } | 704 } |
| 705 | 705 |
| 706 return hr; | 706 return hr; |
| 707 } | 707 } |
| 708 | 708 |
| 709 HRESULT CoreAudioUtil::GetPreferredAudioParameters( | 709 HRESULT CoreAudioUtil::GetPreferredAudioParameters( |
| 710 const std::string& device_id, AudioParameters* params) { | 710 const std::string& device_id, AudioParameters* params) { |
| 711 DCHECK(IsSupported()); | 711 DCHECK(IsSupported()); |
| 712 ScopedComPtr<IMMDevice> device(CreateDevice(device_id)); | 712 ScopedComPtr<IMMDevice> device(CreateDevice(device_id)); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 return false; | 847 return false; |
| 848 | 848 |
| 849 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to | 849 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to |
| 850 // explicitly write silence data to the rendering buffer. | 850 // explicitly write silence data to the rendering buffer. |
| 851 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; | 851 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; |
| 852 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, | 852 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, |
| 853 AUDCLNT_BUFFERFLAGS_SILENT)); | 853 AUDCLNT_BUFFERFLAGS_SILENT)); |
| 854 } | 854 } |
| 855 | 855 |
| 856 } // namespace media | 856 } // namespace media |
| OLD | NEW |