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

Unified Diff: media/audio/audio_output_controller.h

Issue 14600025: Replace AudioSilenceDetector with an AudioPowerMonitor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use CancelableCallback instead of extra-task for close reply. Created 7 years, 5 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/public/browser/media_observer.h ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_controller.h
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index dddb90e368ef25fd02155a30bc392dd27d09d895..5182453f2b7bb15c3f71637364a73528f8f063b9 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -7,6 +7,7 @@
#include "base/atomic_ref_count.h"
#include "base/callback.h"
+#include "base/cancelable_callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
@@ -52,7 +53,7 @@
namespace media {
-class AudioSilenceDetector;
+class AudioPowerMonitor;
class MEDIA_EXPORT AudioOutputController
: public base::RefCountedThreadSafe<AudioOutputController>,
@@ -66,7 +67,7 @@ class MEDIA_EXPORT AudioOutputController
public:
virtual void OnCreated() = 0;
virtual void OnPlaying() = 0;
- virtual void OnAudible(bool is_audible) = 0;
+ virtual void OnPowerMeasured(float power_dbfs, bool clipped) = 0;
virtual void OnPaused() = 0;
virtual void OnError() = 0;
virtual void OnDeviceChange(int new_buffer_size, int new_sample_rate) = 0;
@@ -234,9 +235,10 @@ class MEDIA_EXPORT AudioOutputController
int number_polling_attempts_left_;
// Scans audio samples from OnMoreIOData() as input and causes
- // EventHandler::OnAudbile() to be called whenever a transition to a period of
- // silence or non-silence is detected.
- scoped_ptr<AudioSilenceDetector> silence_detector_;
+ // EventHandler::OnPowerMeasured() to be called with power level measurements
+ // at regular intervals.
+ scoped_ptr<AudioPowerMonitor> power_monitor_;
+ base::CancelableCallback<void(float, bool)> power_monitor_callback_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
};
« no previous file with comments | « content/public/browser/media_observer.h ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698