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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/audio_manager_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/audio_manager_win.cc
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc
index 82a2ddf9b031d80fbd38026bf0bfab33b1a960e9..18d6940abc32db14578c51eb5da0466e2ef2817a 100644
--- a/media/audio/win/audio_manager_win.cc
+++ b/media/audio/win/audio_manager_win.cc
@@ -317,4 +317,22 @@ AudioManager* CreateAudioManager() {
return new AudioManagerWin();
}
+AudioParameters AudioManagerWin::GetPreferredLowLatencyOutputStreamParameters(
+ const AudioParameters& input_params) {
+ // If WASAPI isn't supported we'll fallback to WaveOut, which will take care
+ // of resampling and bits per sample changes.
+ int sample_rate = input_params.sample_rate();
+ 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.
+ if (IsWASAPISupported()) {
+ sample_rate = GetAudioHardwareSampleRate();
+ bits_per_sample = 16;
+ }
+
+ // TODO(dalecurtis): This should include bits per channel and channel layout
+ // eventually.
+ return AudioParameters(
+ AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(),
+ sample_rate, bits_per_sample, GetAudioHardwareBufferSize());
+}
+
} // namespace media
« 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