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

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

Issue 645923002: Add support for audio input mute detection on all platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added default implementation for cras Created 6 years, 2 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_input.h
diff --git a/media/audio/pulse/pulse_input.h b/media/audio/pulse/pulse_input.h
index 60acf2f908719891974eee38326fe528b64d615d..564bfe796093888098e1affe5693f62e33dec8de 100644
--- a/media/audio/pulse/pulse_input.h
+++ b/media/audio/pulse/pulse_input.h
@@ -41,6 +41,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,6 +49,8 @@ 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);
// Helper for the ReadCallback.
void ReadData();
@@ -60,6 +63,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_;

Powered by Google App Engine
This is Rietveld 408576698