Chromium Code Reviews| Index: media/audio/pulse/pulse_input.h |
| diff --git a/media/audio/pulse/pulse_input.h b/media/audio/pulse/pulse_input.h |
| index 60acf2f908719891974eee38326fe528b64d615d..9314f8f599b2e2570807253ee2e3aeb00be8600c 100644 |
| --- a/media/audio/pulse/pulse_input.h |
| +++ b/media/audio/pulse/pulse_input.h |
| @@ -5,6 +5,7 @@ |
| #ifndef MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ |
| #define MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ |
| +#include <pulse/pulseaudio.h> |
| #include <string> |
| #include "base/threading/thread_checker.h" |
| @@ -14,11 +15,6 @@ |
| #include "media/audio/audio_parameters.h" |
| #include "media/base/audio_block_fifo.h" |
| -struct pa_context; |
| -struct pa_source_info; |
| -struct pa_stream; |
| -struct pa_threaded_mainloop; |
| - |
| namespace media { |
| class AudioManagerPulse; |
| @@ -41,6 +37,7 @@ class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> { |
| virtual double GetMaxVolume() override; |
| virtual void SetVolume(double volume) override; |
| virtual double GetVolume() override; |
| + virtual bool IsMuted() override; |
| private: |
| // PulseAudio Callbacks. |
| @@ -48,10 +45,15 @@ class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> { |
| static void StreamNotifyCallback(pa_stream* stream, void* user_data); |
| static void VolumeCallback(pa_context* context, const pa_source_info* info, |
| int error, void* user_data); |
| + static void MuteCallback(pa_context* context, const pa_source_info* info, |
| + int error, void* user_data); |
|
no longer working on chromium
2014/10/14 14:23:29
nit, indentation.
|
| // Helper for the ReadCallback. |
| void ReadData(); |
| + // Utility method used by GetVolume() and IsMuted(). |
| + bool GetSourceInformation(pa_source_info_cb_t callback); |
| + |
| AudioManagerPulse* audio_manager_; |
| AudioInputCallback* callback_; |
| std::string device_name_; |
| @@ -60,6 +62,10 @@ class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> { |
| double volume_; |
| bool stream_started_; |
| + // Set to true in IsMuted() if user has muted the selected microphone in the |
| + // sound settings UI. |
| + bool muted_; |
| + |
| // Holds the data from the OS. |
| AudioBlockFifo fifo_; |