Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / media / audio / audio_input_controller.h
index f2771c7..e1e14ee 100644 (file)
@@ -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);
@@ -254,8 +268,7 @@ class MEDIA_EXPORT AudioInputController
   // Methods called on the audio thread (owned by the AudioManager).
   void DoCreate(AudioManager* audio_manager, const AudioParameters& params,
                 const std::string& device_id);
-  void DoCreateForStream(AudioInputStream* stream_to_control,
-                         bool enable_nodata_timer);
+  void DoCreateForStream(AudioInputStream* stream_to_control);
   void DoRecord();
   void DoClose();
   void DoReportError();
@@ -278,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_;
 
@@ -327,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_;