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

Unified Diff: media/audio/audio_util.cc

Issue 8777003: Move decision if we need to use WASAPI or wave out into separate function. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years 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
Index: media/audio/audio_util.cc
===================================================================
--- media/audio/audio_util.cc (revision 112747)
+++ media/audio/audio_util.cc (working copy)
@@ -243,7 +243,7 @@
// Hardware sample-rate on the Mac can be configured, so we must query.
return AUAudioOutputStream::HardwareSampleRate();
#elif defined(OS_WIN)
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!WindowsSupportWASAPI()) {
// Fall back to Windows Wave implementation on Windows XP or lower
// and use 48kHz as default input sample rate.
return 48000.0;
@@ -265,7 +265,7 @@
// Hardware sample-rate on the Mac can be configured, so we must query.
return AUAudioInputStream::HardwareSampleRate();
#elif defined(OS_WIN)
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!WindowsSupportWASAPI()) {
// Fall back to Windows Wave implementation on Windows XP or lower
// and use 48kHz as default input sample rate.
return 48000.0;
@@ -293,7 +293,7 @@
#if defined(OS_MACOSX)
return 128;
#elif defined(OS_WIN)
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!WindowsSupportWASAPI()) {
// Fall back to Windows Wave implementation on Windows XP or lower
// and assume 48kHz as default sample rate.
return 2048;
@@ -363,4 +363,14 @@
return actual_data_size == kUnknownDataSize;
}
+#if defined(OS_WIN)
+
+bool WindowsSupportWASAPI() {
+ // Note: that function correctly returns that Windows Server 2003 does not
+ // support WASAPI.
+ return base::win::GetVersion() >= base::win::VERSION_VISTA;
+}
+
+#endif
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698