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

Unified Diff: media/audio/audio_input_controller.h

Issue 2919793002: Detect AudioInputStream muting and propagate to MediaStreamAudioSource. (Closed)
Patch Set: Created 3 years, 7 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/audio_input_controller.h
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h
index ff0022dbee32629e567ac114d657a84d00728bb3..39dbb47fc4363059877d03abe7ddc1e8b1b10169 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -14,6 +14,7 @@
#include "base/files/file.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
+#include "base/timer/timer.h"
#include "media/audio/audio_debug_file_writer.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_manager_base.h"
@@ -107,6 +108,7 @@ class MEDIA_EXPORT AudioInputController
ErrorCode error_code) = 0;
virtual void OnLog(AudioInputController* controller,
const std::string& message) = 0;
+ virtual void OnMuted(AudioInputController* controller, bool is_muted) = 0;
protected:
virtual ~EventHandler() {}
@@ -323,6 +325,8 @@ class MEDIA_EXPORT AudioInputController
float* average_power_dbfs,
int* mic_volume_percent);
+ void CheckMutedState();
+
static StreamType ParamsToStreamType(const AudioParameters& params);
// Gives access to the task runner of the creating thread.
@@ -367,6 +371,9 @@ class MEDIA_EXPORT AudioInputController
// Time when the stream started recording.
base::TimeTicks stream_create_time_;
+ bool is_muted_ = false;
+ std::unique_ptr<base::RepeatingTimer> check_muted_state_timer_;
Max Morin 2017/06/02 09:56:05 Does this need to be allocated separately? Otherwi
ossu-chromium 2017/06/02 10:48:00 I'll try to get it as a regular object instead, se
Guido Urdaneta 2017/06/02 13:33:45 Using a regular object should suffice. From the do
+
#if BUILDFLAG(ENABLE_WEBRTC)
// Used for audio debug recordings. Accessed on audio thread.
AudioDebugRecordingHelper debug_recording_helper_;

Powered by Google App Engine
This is Rietveld 408576698