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

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

Issue 10913267: Bypass audio resampler on XP / non-WASAPI wave out path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix! Created 8 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.h ('k') | no next file » | 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 310
311 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, 311 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers,
312 xp_device_id); 312 xp_device_id);
313 } 313 }
314 314
315 /// static 315 /// static
316 AudioManager* CreateAudioManager() { 316 AudioManager* CreateAudioManager() {
317 return new AudioManagerWin(); 317 return new AudioManagerWin();
318 } 318 }
319 319
320 AudioParameters AudioManagerWin::GetPreferredLowLatencyOutputStreamParameters(
321 const AudioParameters& input_params) {
322 // If WASAPI isn't supported we'll fallback to WaveOut, which will take care
323 // of resampling and bits per sample changes.
324 int sample_rate = input_params.sample_rate();
325 int bits_per_sample = input_params.bits_per_sample();
henrika (OOO until Aug 14) 2012/09/14 09:46:46 Do we want this for XP?
DaleCurtis 2012/09/14 09:59:05 It's the existing behavior, so I think so.
326 if (IsWASAPISupported()) {
327 sample_rate = GetAudioHardwareSampleRate();
328 bits_per_sample = 16;
329 }
330
331 // TODO(dalecurtis): This should include bits per channel and channel layout
332 // eventually.
333 return AudioParameters(
334 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(),
335 sample_rate, bits_per_sample, GetAudioHardwareBufferSize());
336 }
337
320 } // namespace media 338 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698