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

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

Issue 10952024: Adding pulseaudio input support to chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and ready for review. Created 7 years, 11 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
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 53c0711d5456ec71038ab0303ddd7bb1b1f2c0db..ef69cde9dcd5b9f1469a1b1bcc2de4728aee9216 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -16,6 +16,7 @@
#include "media/audio/linux/alsa_output.h"
#include "media/audio/linux/alsa_wrapper.h"
#if defined(USE_PULSEAUDIO)
+#include "media/audio/pulse/pulse_input.h"
#include "media/audio/pulse/pulse_output.h"
#endif
#if defined(USE_CRAS)
@@ -61,8 +62,15 @@ bool AudioManagerLinux::HasAudioInputDevices() {
}
AudioManagerLinux::AudioManagerLinux()
- : wrapper_(new AlsaWrapper()) {
+ : wrapper_(new AlsaWrapper())
+#if defined(USE_PULSEAUDIO)
DaleCurtis 2013/01/30 02:54:30 Construct in #if block inside constructor?
no longer working on chromium 2013/02/12 17:35:59 This code is removed.
+ ,pulse_(new PulseInputObject())
+#endif
+ {
SetMaxOutputStreamsAllowed(kMaxOutputStreams);
+#if defined(USE_PULSEAUDIO)
+ DVLOG(1) << "The availability of PulseAudio is " << pulse_->has_pulse();
+#endif
}
AudioManagerLinux::~AudioManagerLinux() {
@@ -119,6 +127,13 @@ void AudioManagerLinux::GetAudioInputDeviceNames(
return;
}
+#if defined(USE_PULSEAUDIO)
+ if (pulse_->has_pulse()) {
DaleCurtis 2013/01/30 02:54:30 Can this be done a la UseCras; i.e. no need for #i
no longer working on chromium 2013/02/12 17:35:59 Removed.
+ pulse_->GetInputDevices(device_names);
+ return;
+ }
+#endif
+
GetAlsaAudioInputDevices(device_names);
}
@@ -305,7 +320,7 @@ AudioOutputStream* AudioManagerLinux::MakeOutputStream(
#if defined(USE_PULSEAUDIO)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
- return new PulseAudioOutputStream(params, this);
+ return new PulseAudioOutputStream(params, this);
DaleCurtis 2013/01/30 02:54:30 Indent is wrong.
no longer working on chromium 2013/02/12 17:35:59 Removed.
}
#endif
@@ -326,6 +341,13 @@ AudioInputStream* AudioManagerLinux::MakeInputStream(
}
#endif
+#if defined(USE_PULSEAUDIO)
+ if (pulse_->has_pulse()) {
+ return new PulseAudioInputStream(this, device_id, params,
+ pulse_->mainloop(), pulse_->context());
+ }
+#endif
+
std::string device_name = (device_id == AudioManagerBase::kDefaultDeviceId) ?
AlsaPcmInputStream::kAutoSelectDevice : device_id;
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAlsaInputDevice)) {

Powered by Google App Engine
This is Rietveld 408576698