Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: media/audio/win/core_audio_util_win.cc

Issue 518433002: Revert of Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | media/base/audio_buffer_converter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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->input_channels(), params->sample_rate(), 701 params->channels(), params->sample_rate(), params->bits_per_sample(),
702 params->bits_per_sample(), params->frames_per_buffer(), 702 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
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
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | media/base/audio_buffer_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698