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

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

Issue 10592014: media/audio/linux: Add CrasInputStream. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase before trying cq Created 8 years, 5 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 | « no previous file | media/audio/linux/cras_input.h » ('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 0b34aaa81186e0e6a491895c8364c5817cab0e39..8a8cad219c0f30813436ba13adda17b4473ff27b 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -18,6 +18,7 @@
#include "media/audio/pulse/pulse_output.h"
#endif
#if defined(USE_CRAS)
+#include "media/audio/linux/cras_input.h"
#include "media/audio/linux/cras_output.h"
#endif
#include "media/base/limits.h"
@@ -267,36 +268,34 @@ AudioInputStream* AudioManagerLinux::MakeLowLatencyInputStream(
AudioOutputStream* AudioManagerLinux::MakeOutputStream(
const AudioParameters& params) {
- AudioOutputStream* stream = NULL;
#if defined(USE_CRAS)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
- stream = new CrasOutputStream(params, this);
- } else {
+ return new CrasOutputStream(params, this);
+ }
#endif
+
#if defined(USE_PULSEAUDIO)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
- stream = new PulseAudioOutputStream(params, this);
- } else {
-#endif
- std::string device_name = AlsaPcmOutputStream::kAutoSelectDevice;
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAlsaOutputDevice)) {
- device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kAlsaOutputDevice);
- }
- stream = new AlsaPcmOutputStream(device_name, params, wrapper_.get(), this);
-#if defined(USE_PULSEAUDIO)
+ return new PulseAudioOutputStream(params, this);
}
#endif
-#if defined(USE_CRAS)
+
+ std::string device_name = AlsaPcmOutputStream::kAutoSelectDevice;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAlsaOutputDevice)) {
+ device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kAlsaOutputDevice);
}
-#endif
- DCHECK(stream);
- return stream;
+ return new AlsaPcmOutputStream(device_name, params, wrapper_.get(), this);
}
AudioInputStream* AudioManagerLinux::MakeInputStream(
const AudioParameters& params, const std::string& device_id) {
+#if defined(USE_CRAS)
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
+ return new CrasInputStream(params, this);
+ }
+#endif
std::string device_name = (device_id == AudioManagerBase::kDefaultDeviceId) ?
AlsaPcmInputStream::kAutoSelectDevice : device_id;
« no previous file with comments | « no previous file | media/audio/linux/cras_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698