#include "media/base/audio_shifter.h"
#include <algorithm>
#include <cmath>
#include <utility>
#include "base/containers/circular_deque.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
#include "media/base/audio_bus.h"
namespace media {
static bool between(double x, double a, double b) { … }
class ClockSmoother { … };
AudioShifter::AudioQueueEntry::AudioQueueEntry(
base::TimeTicks target_playout_time,
std::unique_ptr<AudioBus> audio)
: … { … }
AudioShifter::AudioQueueEntry::AudioQueueEntry(AudioQueueEntry&& other) =
default;
AudioShifter::AudioQueueEntry::~AudioQueueEntry() = default;
AudioShifter::AudioShifter(base::TimeDelta max_buffer_size,
base::TimeDelta clock_accuracy,
base::TimeDelta adjustment_time,
int rate,
int channels)
: … { … }
AudioShifter::~AudioShifter() = default;
void AudioShifter::Push(std::unique_ptr<AudioBus> input,
base::TimeTicks playout_time) { … }
void AudioShifter::Pull(AudioBus* output,
base::TimeTicks playout_time) { … }
void AudioShifter::Zero(AudioBus* output) { … }
void AudioShifter::ResamplerCallback(int frame_delay, AudioBus* destination) { … }
}