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

Unified Diff: media/audio/pulse/pulse_input.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: latest Created 4 years, 9 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/pulse/pulse_input.cc » ('j') | media/audio/pulse/pulse_input.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/pulse/pulse_input.h
diff --git a/media/audio/pulse/pulse_input.h b/media/audio/pulse/pulse_input.h
index e0b2be9e2ef31134f7680b59e82956708844ca7f..b2de54fde76147fd4e491a13fd46c9638858dcb8 100644
--- a/media/audio/pulse/pulse_input.h
+++ b/media/audio/pulse/pulse_input.h
@@ -41,6 +41,9 @@ class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> {
double GetVolume() override;
bool IsMuted() override;
+ pa_threaded_mainloop* GetPAMainloop();
+ void SetDefaultSystemDeviceName(const std::string& name);
+
private:
// PulseAudio Callbacks.
static void ReadCallback(pa_stream* handle, size_t length, void* user_data);
@@ -52,6 +55,9 @@ class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> {
int error,
void* user_data);
+ // Get default system input device for the input stream.
+ void GetSystemDefaultInputDevice();
+
// Helper for the ReadCallback.
void ReadData();
@@ -60,7 +66,12 @@ class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> {
AudioManagerPulse* audio_manager_;
AudioInputCallback* callback_;
- std::string device_name_;
+ const std::string device_name_;
+ // The name of the system default device. Set by
+ // GetSystemDefaultInputDeviceCallback if |device_name_| is set to be the
+ // default device.
+ std::string default_system_device_name_;
+
AudioParameters params_;
int channels_;
double volume_;
« no previous file with comments | « no previous file | media/audio/pulse/pulse_input.cc » ('j') | media/audio/pulse/pulse_input.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698