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

Unified Diff: media/audio/audio_input_controller.h

Issue 462813004: Add UMA stats for silence AudioInputController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review + rebase. Created 6 years, 4 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 | « no previous file | 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 5fdb0c08cefebfad40f577ab562d25c3dc92aa6f..e1e14ee3c30e94b07ed34f0043e215b635a94168 100644
--- a/media/audio/audio_input_controller.h
+++ b/media/audio/audio_input_controller.h
@@ -246,6 +246,20 @@ class MEDIA_EXPORT AudioInputController
CLOSED
};
+#if defined(AUDIO_POWER_MONITORING)
+ // Used to log a silence report (see OnData).
+ // Elements in this enum should not be deleted or rearranged; the only
+ // permitted operation is to add new elements before SILENCE_STATE_MAX and
+ // update SILENCE_STATE_MAX.
+ enum SilenceState {
+ SILENCE_STATE_NO_MEASUREMENT = 0,
+ SILENCE_STATE_ONLY_AUDIO = 1,
+ SILENCE_STATE_ONLY_SILENCE = 2,
+ SILENCE_STATE_AUDIO_AND_SILENCE = 3,
+ SILENCE_STATE_MAX = SILENCE_STATE_AUDIO_AND_SILENCE
+ };
+#endif
+
AudioInputController(EventHandler* handler,
SyncWriter* sync_writer,
UserInputMonitor* user_input_monitor);
@@ -277,6 +291,10 @@ class MEDIA_EXPORT AudioInputController
void SetDataIsActive(bool enabled);
bool GetDataIsActive();
+#if defined(AUDIO_POWER_MONITORING)
+ void LogSilenceState(SilenceState value);
+#endif
+
// Gives access to the task runner of the creating thread.
scoped_refptr<base::SingleThreadTaskRunner> creator_task_runner_;
@@ -326,6 +344,9 @@ class MEDIA_EXPORT AudioInputController
// We need these to be able to feed data to the AudioPowerMonitor.
media::AudioParameters audio_params_;
base::TimeTicks last_audio_level_log_time_;
+
+ // The silence report sent as UMA stat at the end of a session.
+ SilenceState silence_state_;
#endif
size_t prev_key_down_count_;
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698