Chromium Code Reviews| 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..5c8a592fc979db44d14f494ca35b2d6fa3939870 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,19 @@ 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 |
| + // GetSystemDefaultOutputDevice to set |device_name_| to the |
| + // default system output device. |
| + static void GetSystemDefaultOutputDeviceCallback(pa_context* context, |
| + const pa_server_info* info, |
| + void* user_data); |
| + |
| + bool InitializeMainloopAndContext(std::string& app_name, |
|
Henrik Grunell
2016/03/09 00:49:17
Add comment with description.
Henrik Grunell
2016/03/09 00:49:17
const std::string& (both arguments).
rchtara
2016/03/09 16:16:10
Done.
rchtara
2016/03/09 16:16:10
Done.
|
| + std::string& device_to_use_); |
|
Henrik Grunell
2016/03/09 00:49:17
Remove trailing "_".
rchtara
2016/03/09 16:16:10
Done.
|
| + |
| + // Get default system output device for the output stream. |
| + void GetSystemDefaultOutputDevice(); |
| + |
| // Fulfill a write request from the write request callback. Outputs silence |
| // if the request could not be fulfilled. |
| void FulfillWriteRequest(size_t requested_bytes); |
| @@ -75,6 +89,9 @@ class PulseAudioOutputStream : public AudioOutputStream { |
| // The device ID for the device to open. |
| const std::string device_id_; |
| + // The name of the system default device. Returned |
| + // by GetSystemDefaultOutputDeviceCallback. |
| + std::string default_system_device_name_; |
| // Audio manager that created us. Used to report that we've closed. |
| AudioManagerBase* manager_; |