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

Unified Diff: media/audio/pulse/pulse_util.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: fix issues 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_util.h
diff --git a/media/audio/pulse/pulse_util.h b/media/audio/pulse/pulse_util.h
index b8e5cdcda4c606eaef98770e1507bbff99522855..b71f5e3e5015a2464cdd928c75cac009accaf859 100644
--- a/media/audio/pulse/pulse_util.h
+++ b/media/audio/pulse/pulse_util.h
@@ -49,6 +49,16 @@ int GetHardwareLatencyInBytes(pa_stream* stream,
int sample_rate,
int bytes_per_frame);
+// pa_context_get_server_info callback. It's used by GetSystemDefaultInputDevice
+// to get the system default input device name.
+void SystemDefaultInputDeviceCallback(pa_context* context,
+ const pa_server_info* info,
+ void* user_data);
+
+// Return the system default input device name using pa_context_get_server_info.
+std::string GetSystemDefaultInputDevice(pa_threaded_mainloop* mainloop,
+ pa_context* context);
+
// Create a recording stream for the threaded mainloop, return true if success,
// otherwise false. |mainloop| and |context| have to be from a valid Pulse
// threaded mainloop and the handle of the created stream will be returned by
@@ -61,6 +71,17 @@ bool CreateInputStream(pa_threaded_mainloop* mainloop,
pa_stream_notify_cb_t stream_callback,
void* user_data);
+// pa_context_get_server_info callback. It's used by
+// GetSystemDefaultOutputDevice to get the system default output device name.
+void SystemDefaultOutputDeviceCallback(pa_context* context,
+ const pa_server_info* info,
+ void* user_data);
+
+// Return the system default output device name using
+// pa_context_get_server_info.
+std::string GetSystemDefaultOutputDevice(pa_threaded_mainloop* mainloop,
+ pa_context* context);
+
// Create a playback stream for the threaded mainloop, return true if success,
// otherwise false. This function will create a new Pulse threaded mainloop,
// and the handles of the mainloop, context and stream will be returned by

Powered by Google App Engine
This is Rietveld 408576698