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

Unified Diff: media/audio/audio_power_monitor.h

Issue 287873004: Adds volume level measurements to the AudioInputController for low-latency clients (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactored Created 6 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_power_monitor.h
diff --git a/media/audio/audio_power_monitor.h b/media/audio/audio_power_monitor.h
index f840bbf6b9f0f23912b7af870ba080a552f34202..d3e86d46d323cef6eda981b03b89f01370483834 100644
--- a/media/audio/audio_power_monitor.h
+++ b/media/audio/audio_power_monitor.h
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/synchronization/lock.h"
+#include "media/audio/audio_parameters.h"
#include "media/base/media_export.h"
// An audio signal power monitor. It is periodically provided an AudioBus by
@@ -40,6 +41,7 @@ class MEDIA_EXPORT AudioPowerMonitor {
// level; and is the amount of time it takes a zero power level to increase to
// ~63.2% of maximum given a step input signal.
AudioPowerMonitor(int sample_rate, const base::TimeDelta& time_constant);
+ AudioPowerMonitor(const AudioParameters& params);
~AudioPowerMonitor();
@@ -50,6 +52,7 @@ class MEDIA_EXPORT AudioPowerMonitor {
// Scan more |frames| of audio data from |buffer|. It is safe to call this
// from a real-time priority thread.
void Scan(const AudioBus& buffer, int frames);
+ void Scan(const void* data, uint32 size);
// Returns the current power level in dBFS and clip status. Clip status is
// true whenever any *one* sample scanned exceeded maximum amplitude since
@@ -79,6 +82,9 @@ class MEDIA_EXPORT AudioPowerMonitor {
float power_reading_;
bool clipped_reading_;
+ scoped_ptr<AudioBus> audio_bus_;
+ AudioParameters params_;
+
DISALLOW_COPY_AND_ASSIGN(AudioPowerMonitor);
};

Powered by Google App Engine
This is Rietveld 408576698