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

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

Issue 11878032: Plumb |input_channels| all the way to AudioManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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/mac/audio_manager_mac.cc ('k') | media/base/audio_renderer_sink.h » ('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/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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if (params.channels() > kWinMaxChannels) 285 if (params.channels() > kWinMaxChannels)
286 return NULL; 286 return NULL;
287 287
288 if (!CoreAudioUtil::IsSupported()) { 288 if (!CoreAudioUtil::IsSupported()) {
289 // Fall back to Windows Wave implementation on Windows XP or lower. 289 // Fall back to Windows Wave implementation on Windows XP or lower.
290 DVLOG(1) << "Using WaveOut since WASAPI requires at least Vista."; 290 DVLOG(1) << "Using WaveOut since WASAPI requires at least Vista.";
291 return new PCMWaveOutAudioOutputStream( 291 return new PCMWaveOutAudioOutputStream(
292 this, params, media::NumberOfWaveOutBuffers(), WAVE_MAPPER); 292 this, params, media::NumberOfWaveOutBuffers(), WAVE_MAPPER);
293 } 293 }
294 294
295 // TODO(henrika): remove once we properly handle input device selection. 295 // TODO(crogers): support more than stereo input.
296 if (CommandLine::ForCurrentProcess()->HasSwitch( 296 // TODO(henrika): remove flag once we properly handle input device selection.
297 // https://code.google.com/p/chromium/issues/detail?id=147327
298 if (params.input_channels() == 2 &&
299 CommandLine::ForCurrentProcess()->HasSwitch(
297 switches::kEnableWebAudioInput)) { 300 switches::kEnableWebAudioInput)) {
298 if (WASAPIUnifiedStream::HasUnifiedDefaultIO()) { 301 if (WASAPIUnifiedStream::HasUnifiedDefaultIO()) {
299 DVLOG(1) << "WASAPIUnifiedStream is created."; 302 DVLOG(1) << "WASAPIUnifiedStream is created.";
300 return new WASAPIUnifiedStream(this, params); 303 return new WASAPIUnifiedStream(this, params);
301 } 304 }
302 LOG(WARNING) << "Unified audio I/O is not supported."; 305 LOG(WARNING) << "Unified audio I/O is not supported.";
303 } 306 }
304 307
305 return new WASAPIAudioOutputStream(this, params, eConsole); 308 return new WASAPIAudioOutputStream(this, params, eConsole);
306 } 309 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 channel_layout = WASAPIAudioOutputStream::HardwareChannelLayout(); 371 channel_layout = WASAPIAudioOutputStream::HardwareChannelLayout();
369 } 372 }
370 373
371 // TODO(dalecurtis): This should include hardware bits per channel eventually. 374 // TODO(dalecurtis): This should include hardware bits per channel eventually.
372 return AudioParameters( 375 return AudioParameters(
373 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, 376 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
374 sample_rate, bits_per_sample, GetAudioHardwareBufferSize()); 377 sample_rate, bits_per_sample, GetAudioHardwareBufferSize());
375 } 378 }
376 379
377 } // namespace media 380 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mac/audio_manager_mac.cc ('k') | media/base/audio_renderer_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698