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

Unified Diff: media/audio/win/audio_manager_win.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
« media/audio/audio_util.h ('K') | « media/audio/audio_util.cc ('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
===================================================================
--- media/audio/win/audio_manager_win.cc (revision 112747)
+++ media/audio/win/audio_manager_win.cc (working copy)
@@ -18,7 +18,7 @@
#include "base/process_util.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
-#include "base/win/windows_version.h"
+#include "media/audio/audio_util.h"
#include "media/audio/fake_audio_input_stream.h"
#include "media/audio/fake_audio_output_stream.h"
#include "media/audio/win/audio_low_latency_input_win.h"
@@ -100,7 +100,7 @@
AudioManagerWin::AudioManagerWin()
: num_output_streams_(0) {
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!media::WindowsSupportWASAPI()) {
// Use the Wave API for device enumeration if XP or lower.
enumeration_type_ = kWaveEnumeration;
} else {
@@ -141,7 +141,7 @@
return new PCMWaveOutAudioOutputStream(this, params, 3, WAVE_MAPPER);
} else if (params.format == AudioParameters::AUDIO_PCM_LOW_LATENCY) {
num_output_streams_++;
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!media::WindowsSupportWASAPI()) {
// Fall back to Windows Wave implementation on Windows XP or lower.
DLOG(INFO) << "Using WaveOut since WASAPI requires at least Vista.";
return new PCMWaveOutAudioOutputStream(this, params, 2, WAVE_MAPPER);
@@ -167,7 +167,7 @@
return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers,
WAVE_MAPPER);
} else if (params.format == AudioParameters::AUDIO_PCM_LOW_LATENCY) {
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!media::WindowsSupportWASAPI()) {
// Fall back to Windows Wave implementation on Windows XP or lower.
DLOG(INFO) << "Using WaveIn since WASAPI requires at least Vista.";
// TODO(xians): Handle the non-default device.
@@ -272,7 +272,7 @@
void AudioManagerWin::ShowAudioInputSettings() {
std::wstring program;
std::string argument;
- if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ if (!media::WindowsSupportWASAPI()) {
program = L"sndvol32.exe";
argument = "-R";
} else {
« media/audio/audio_util.h ('K') | « media/audio/audio_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698