| 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 <functiondiscoverykeys_devpkey.h> | 8 #include <functiondiscoverykeys_devpkey.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 params->sample_rate(), params->bits_per_sample(), | 779 params->sample_rate(), params->bits_per_sample(), |
| 780 params->frames_per_buffer()); | 780 params->frames_per_buffer()); |
| 781 } | 781 } |
| 782 | 782 |
| 783 ScopedComPtr<IMMDevice> communications_device( | 783 ScopedComPtr<IMMDevice> communications_device( |
| 784 CreateDefaultDevice(eCapture, eCommunications)); | 784 CreateDefaultDevice(eCapture, eCommunications)); |
| 785 if (communications_device && | 785 if (communications_device && |
| 786 GetDeviceID(communications_device.get()) == GetDeviceID(device.get())) { | 786 GetDeviceID(communications_device.get()) == GetDeviceID(device.get())) { |
| 787 // Raise the 'DUCKING' flag for default communication devices. | 787 // Raise the 'DUCKING' flag for default communication devices. |
| 788 *params = | 788 *params = |
| 789 AudioParameters(params->format(), params->channel_layout(), | 789 AudioParameters(params->format(), params->channels(), |
| 790 params->channels(), params->sample_rate(), | 790 params->channel_layout(), params->sample_rate(), |
| 791 params->bits_per_sample(), params->frames_per_buffer(), | 791 params->bits_per_sample(), params->frames_per_buffer(), |
| 792 params->effects() | AudioParameters::DUCKING); | 792 "", params->effects() | AudioParameters::DUCKING); |
| 793 } | 793 } |
| 794 | 794 |
| 795 return hr; | 795 return hr; |
| 796 } | 796 } |
| 797 | 797 |
| 798 ChannelConfig CoreAudioUtil::GetChannelConfig(const std::string& device_id, | 798 ChannelConfig CoreAudioUtil::GetChannelConfig(const std::string& device_id, |
| 799 EDataFlow data_flow) { | 799 EDataFlow data_flow) { |
| 800 ScopedComPtr<IAudioClient> client( | 800 ScopedComPtr<IAudioClient> client( |
| 801 CreateClient(device_id, data_flow, eConsole)); | 801 CreateClient(device_id, data_flow, eConsole)); |
| 802 | 802 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 return false; | 917 return false; |
| 918 | 918 |
| 919 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to | 919 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to |
| 920 // explicitly write silence data to the rendering buffer. | 920 // explicitly write silence data to the rendering buffer. |
| 921 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; | 921 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; |
| 922 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, | 922 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, |
| 923 AUDCLNT_BUFFERFLAGS_SILENT)); | 923 AUDCLNT_BUFFERFLAGS_SILENT)); |
| 924 } | 924 } |
| 925 | 925 |
| 926 } // namespace media | 926 } // namespace media |
| OLD | NEW |