#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/base/audio_buffer_converter.h"
#include <algorithm>
#include <cmath>
#include <memory>
#include "base/check_op.h"
#include "media/base/audio_bus.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/sinc_resampler.h"
#include "media/base/timestamp_constants.h"
#include "media/base/vector_math.h"
namespace media {
static bool IsConfigChange(const AudioParameters& params,
const AudioBuffer& buffer) { … }
AudioBufferConverter::AudioBufferConverter(const AudioParameters& output_params)
: … { … }
AudioBufferConverter::~AudioBufferConverter() = default;
void AudioBufferConverter::AddInput(scoped_refptr<AudioBuffer> buffer) { … }
bool AudioBufferConverter::HasNextBuffer() { … }
scoped_refptr<AudioBuffer> AudioBufferConverter::GetNextBuffer() { … }
void AudioBufferConverter::Reset() { … }
void AudioBufferConverter::ResetTimestampState() { … }
double AudioBufferConverter::ProvideInput(AudioBus* audio_bus,
uint32_t frames_delayed,
const AudioGlitchInfo& glitch_info) { … }
void AudioBufferConverter::ResetConverter(const AudioBuffer& buffer) { … }
void AudioBufferConverter::ConvertIfPossible() { … }
void AudioBufferConverter::Flush() { … }
}