#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_level_calculator.h"
#include <cmath>
#include <limits>
#include "base/check.h"
#include "base/memory/scoped_refptr.h"
#include "base/types/pass_key.h"
#include "media/base/audio_bus.h"
namespace blink {
namespace {
float MaxAmplitude(const float* audio_data, int length) { … }
}
MediaStreamAudioLevelCalculator::Level::Level(
base::PassKey<MediaStreamAudioLevelCalculator>) { … }
MediaStreamAudioLevelCalculator::Level::~Level() = default;
float MediaStreamAudioLevelCalculator::Level::GetCurrent() const { … }
void MediaStreamAudioLevelCalculator::Level::Set(float level) { … }
MediaStreamAudioLevelCalculator::MediaStreamAudioLevelCalculator()
: … { … }
MediaStreamAudioLevelCalculator::~MediaStreamAudioLevelCalculator() { … }
void MediaStreamAudioLevelCalculator::Calculate(
const media::AudioBus& audio_bus,
bool assume_nonzero_energy) { … }
}