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

Unified Diff: media/audio/linux/audio_manager_linux.cc

Issue 275022: Move Alsa device opening into the audio thread, and add in support for multi-channel audio. (Closed)
Patch Set: Fix up the unittests since we not only downmix for a very small set of channels. Created 11 years, 2 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/linux/alsa_wrapper.cc ('k') | media/audio/mac/audio_output_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/linux/audio_manager_linux.cc
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc
index 0c4db6aa7c8b703ca5bba7663827eeb7bb31b0f0..9d395e8e1504ba1578813a78fa6e66564c96de9a 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -5,10 +5,13 @@
#include "media/audio/linux/audio_manager_linux.h"
#include "base/at_exit.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "media/audio/fake_audio_output_stream.h"
#include "media/audio/linux/alsa_output.h"
#include "media/audio/linux/alsa_wrapper.h"
+#include "media/base/media_switches.h"
+
namespace {
AudioManagerLinux* g_audio_manager = NULL;
@@ -34,15 +37,14 @@ AudioOutputStream* AudioManagerLinux::MakeAudioStream(Format format,
return NULL;
}
- // TODO(ajwong): Do we want to be able to configure the device? default
- // should work correctly for all mono/stereo, but not surround, which needs
- // surround40, surround51, etc.
- //
- // http://0pointer.de/blog/projects/guide-to-sound-apis.html
+ std::string device_name = AlsaPcmOutputStream::kAutoSelectDevice;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAlsaDevice)) {
+ device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kAlsaDevice);
+ }
AlsaPcmOutputStream* stream =
- new AlsaPcmOutputStream(AlsaPcmOutputStream::kDefaultDevice,
- format, channels, sample_rate, bits_per_sample,
- wrapper_.get(), this,
+ new AlsaPcmOutputStream(device_name, format, channels, sample_rate,
+ bits_per_sample, wrapper_.get(), this,
audio_thread_.message_loop());
AutoLock l(lock_);
« no previous file with comments | « media/audio/linux/alsa_wrapper.cc ('k') | media/audio/mac/audio_output_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698