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

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

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix more constructors and disable for now. Created 5 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
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/audio_io.h" 5 #include "media/audio/audio_io.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <objbase.h> // This has to be before initguid.h 8 #include <objbase.h> // This has to be before initguid.h
9 #include <initguid.h> 9 #include <initguid.h>
10 #include <mmsystem.h> 10 #include <mmsystem.h>
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 const std::string& device_id) { 305 const std::string& device_id) {
306 HRESULT hr = E_FAIL; 306 HRESULT hr = E_FAIL;
307 AudioParameters parameters; 307 AudioParameters parameters;
308 if (core_audio_supported()) { 308 if (core_audio_supported()) {
309 hr = CoreAudioUtil::GetPreferredAudioParameters(device_id, false, 309 hr = CoreAudioUtil::GetPreferredAudioParameters(device_id, false,
310 &parameters); 310 &parameters);
311 } 311 }
312 312
313 if (FAILED(hr) || !parameters.IsValid()) { 313 if (FAILED(hr) || !parameters.IsValid()) {
314 // Windows Wave implementation is being used. 314 // Windows Wave implementation is being used.
315 parameters = AudioParameters( 315 parameters =
316 AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_STEREO, 48000, 16, 316 AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
317 kFallbackBufferSize, AudioParameters::NO_EFFECTS); 317 CHANNEL_LAYOUT_STEREO, 48000, 16, kFallbackBufferSize);
318 } 318 }
319 319
320 int user_buffer_size = GetUserBufferSize(); 320 int user_buffer_size = GetUserBufferSize();
321 if (user_buffer_size) { 321 if (user_buffer_size) {
322 parameters.Reset(parameters.format(), parameters.channel_layout(), 322 parameters.Reset(parameters.format(), parameters.channel_layout(),
323 parameters.channels(), parameters.sample_rate(), 323 parameters.channels(), parameters.sample_rate(),
324 parameters.bits_per_sample(), user_buffer_size); 324 parameters.bits_per_sample(), user_buffer_size);
325 } 325 }
326 326
327 return parameters; 327 return parameters;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, 533 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers,
534 xp_device_id); 534 xp_device_id);
535 } 535 }
536 536
537 /// static 537 /// static
538 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { 538 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) {
539 return new AudioManagerWin(audio_log_factory); 539 return new AudioManagerWin(audio_log_factory);
540 } 540 }
541 541
542 } // namespace media 542 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698