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

Unified Diff: media/audio/audio_input_controller.h

Issue 2941773002: Added initial muted state to stream creation callback, to avoid races. (Closed)
Patch Set: Added mute information to DoCompleteCreation log message. Created 3 years, 6 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 | « content/renderer/pepper/pepper_platform_audio_input.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.h
diff --git a/media/audio/audio_input_controller.h b/media/audio/audio_input_controller.h
index b037996870da6af6af536c4909c07776d61f4803..2b8669c27555e9db338f381e0d98af83f694e62a 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -104,15 +104,16 @@ class MEDIA_EXPORT AudioInputController
// following methods are all called on the audio thread.
class MEDIA_EXPORT EventHandler {
public:
- virtual void OnCreated(AudioInputController* controller) = 0;
+ // The initial "muted" state of the underlying stream is sent along with the
+ // OnCreated callback, to avoid the stream being treated as unmuted until an
+ // OnMuted callback has had time to be processed.
+ virtual void OnCreated(AudioInputController* controller,
+ bool initially_muted) = 0;
virtual void OnError(AudioInputController* controller,
ErrorCode error_code) = 0;
virtual void OnLog(AudioInputController* controller,
const std::string& message) = 0;
- // Initially, an AudioInputController is considered not muted. If the
- // underlying stream is actually muted, an OnMuted callback will follow
- // shortly after OnCreated. It is also called whenever the muted state of
- // the underlying stream changes.
+ // Called whenever the muted state of the underlying stream changes.
virtual void OnMuted(AudioInputController* controller, bool is_muted) = 0;
protected:
« no previous file with comments | « content/renderer/pepper/pepper_platform_audio_input.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698