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

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

Issue 13515005: Adds support for CoreAudioUtil::IsChannelLayoutSupported() (II) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for browser_tests on XP Created 7 years, 8 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
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // TODO(henrika): Figure out the right thing to do here. 383 // TODO(henrika): Figure out the right thing to do here.
384 if (hw_sample_rate && hw_buffer_size) { 384 if (hw_sample_rate && hw_buffer_size) {
385 sample_rate = hw_sample_rate; 385 sample_rate = hw_sample_rate;
386 buffer_size = hw_buffer_size; 386 buffer_size = hw_buffer_size;
387 } else { 387 } else {
388 use_input_params = true; 388 use_input_params = true;
389 } 389 }
390 } 390 }
391 391
392 if (input_params.IsValid()) { 392 if (input_params.IsValid()) {
393 if (CoreAudioUtil::IsSupported() &&
394 CoreAudioUtil::IsChannelLayoutSupported(eRender, eConsole,
395 input_params.channel_layout())) {
396 // Open up using the same channel layout as the source if it is
397 // supported by the hardware.
398 channel_layout = input_params.channel_layout();
399 VLOG(1) << "Hardware channel layout is not used; using same "
400 << "layout as the source instead (" << channel_layout << ")";
401 }
393 input_channels = input_params.input_channels(); 402 input_channels = input_params.input_channels();
394 if (use_input_params) { 403 if (use_input_params) {
395 // If WASAPI isn't supported we'll fallback to WaveOut, which will take 404 // If WASAPI isn't supported we'll fallback to WaveOut, which will take
396 // care of resampling and bits per sample changes. By setting these 405 // care of resampling and bits per sample changes. By setting these
397 // equal to the input values, AudioOutputResampler will skip resampling 406 // equal to the input values, AudioOutputResampler will skip resampling
398 // and bit per sample differences (since the input parameters will match 407 // and bit per sample differences (since the input parameters will match
399 // the output parameters). 408 // the output parameters).
400 sample_rate = input_params.sample_rate(); 409 sample_rate = input_params.sample_rate();
401 bits_per_sample = input_params.bits_per_sample(); 410 bits_per_sample = input_params.bits_per_sample();
402 channel_layout = input_params.channel_layout(); 411 channel_layout = input_params.channel_layout();
(...skipping 27 matching lines...) Expand all
430 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, 439 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers,
431 xp_device_id); 440 xp_device_id);
432 } 441 }
433 442
434 /// static 443 /// static
435 AudioManager* CreateAudioManager() { 444 AudioManager* CreateAudioManager() {
436 return new AudioManagerWin(); 445 return new AudioManagerWin();
437 } 446 }
438 447
439 } // namespace media 448 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/win/core_audio_util_win.h » ('j') | media/audio/win/core_audio_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698