chromium/media/base/audio_power_monitor.h

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_AUDIO_POWER_MONITOR_H_
#define MEDIA_BASE_AUDIO_POWER_MONITOR_H_

#include <limits>
#include <utility>

#include "base/synchronization/lock.h"
#include "media/base/media_export.h"

// An audio signal power monitor.  It is periodically provided an AudioBus by
// the native audio thread, and the audio samples in each channel are analyzed
// to determine the average power of the signal over a time period.  Here
// "average power" is a running average calculated by using a first-order
// low-pass filter over the square of the samples scanned.  Whenever reporting
// the power level, this running average is converted to dBFS (decibels relative
// to full-scale) units.
//
// Note that extreme care has been taken to make the AudioPowerMonitor::Scan()
// method safe to be called on the native audio thread.  The code acquires no
// locks, nor engages in any operation that could result in an
// undetermined/unbounded amount of run-time.

namespace base {
class TimeDelta;
}

namespace media {

class AudioBus;

class MEDIA_EXPORT AudioPowerMonitor {};

}  // namespace media

#endif  // MEDIA_BASE_AUDIO_POWER_MONITOR_H_