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

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

Issue 12918026: Adds support for CoreAudioUtil::IsChannelLayoutSupported() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit 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
« no previous file with comments | « no previous file | media/audio/win/core_audio_util_win.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 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::IsChannelLayoutSupported(
394 eRender, eConsole, input_params.channel_layout())) {
395 // Open up using the same channel layout as the source if it is
396 // supported by the hardware.
397 channel_layout = input_params.channel_layout();
398 VLOG(1) << "Hardware channel layout is not used; using same "
399 << "layout as the source instead (" << channel_layout << ")";
400 }
393 input_channels = input_params.input_channels(); 401 input_channels = input_params.input_channels();
394 if (use_input_params) { 402 if (use_input_params) {
395 // If WASAPI isn't supported we'll fallback to WaveOut, which will take 403 // 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 404 // care of resampling and bits per sample changes. By setting these
397 // equal to the input values, AudioOutputResampler will skip resampling 405 // equal to the input values, AudioOutputResampler will skip resampling
398 // and bit per sample differences (since the input parameters will match 406 // and bit per sample differences (since the input parameters will match
399 // the output parameters). 407 // the output parameters).
400 sample_rate = input_params.sample_rate(); 408 sample_rate = input_params.sample_rate();
401 bits_per_sample = input_params.bits_per_sample(); 409 bits_per_sample = input_params.bits_per_sample();
402 channel_layout = input_params.channel_layout(); 410 channel_layout = input_params.channel_layout();
(...skipping 27 matching lines...) Expand all
430 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, 438 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers,
431 xp_device_id); 439 xp_device_id);
432 } 440 }
433 441
434 /// static 442 /// static
435 AudioManager* CreateAudioManager() { 443 AudioManager* CreateAudioManager() {
436 return new AudioManagerWin(); 444 return new AudioManagerWin();
437 } 445 }
438 446
439 } // namespace media 447 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/win/core_audio_util_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698