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

Unified Diff: media/audio/pulse/pulse_output.h

Issue 1711823004: Let default device in PulseAudio be the system default device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/pulse/pulse_output.h
diff --git a/media/audio/pulse/pulse_output.h b/media/audio/pulse/pulse_output.h
index ce9a58914ece8af79409b0c537605e650d59060c..e8b478a9ecb541a6f6ecbee3c56e61a2bad6f4e2 100644
--- a/media/audio/pulse/pulse_output.h
+++ b/media/audio/pulse/pulse_output.h
@@ -20,6 +20,7 @@
#ifndef MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_
#define MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_
+#include <pulse/pulseaudio.h>
#include <stddef.h>
#include <string>
@@ -63,6 +64,16 @@ class PulseAudioOutputStream : public AudioOutputStream {
// Called by PulseAudio when it needs more audio data.
static void StreamRequestCallback(pa_stream* s, size_t len, void* p_this);
+ // pa_context_get_server_info callback. It's used by
+ // UseSystemDefaultOutputDevice to set |device_name_| to the
+ // default system output device.
+ static void UseSystemDefaultOutputDeviceCallback(pa_context* context,
+ const pa_server_info* info,
+ void* user_data);
+
+ // Use default system output device for the output stream.
+ void UseSystemDefaultOutputDevice();
Henrik Grunell 2016/03/07 11:37:17 Rename to GetSystem...().
rchtara 2016/03/08 17:28:17 Done.
+
// Fulfill a write request from the write request callback. Outputs silence
// if the request could not be fulfilled.
void FulfillWriteRequest(size_t requested_bytes);
@@ -74,7 +85,7 @@ class PulseAudioOutputStream : public AudioOutputStream {
const AudioParameters params_;
// The device ID for the device to open.
- const std::string device_id_;
+ std::string device_id_;
Henrik Grunell 2016/03/07 11:37:17 You need to keep const std::string device_id_; and
rchtara 2016/03/08 17:28:17 Done.
// Audio manager that created us. Used to report that we've closed.
AudioManagerBase* manager_;

Powered by Google App Engine
This is Rietveld 408576698