#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "services/audio/mixing_graph_impl.h"
#include "base/compiler_specific.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/trace_event/trace_event.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/loopback_audio_converter.h"
#include "services/audio/sync_mixing_graph_input.h"
namespace audio {
namespace {
std::unique_ptr<media::LoopbackAudioConverter> CreateConverter(
const media::AudioParameters& input_params,
const media::AudioParameters& output_params) { … }
void SanitizeOutput(media::AudioBus* bus) { … }
bool SameChannelSetup(const media::AudioParameters& a,
const media::AudioParameters& b) { … }
}
class MixingGraphImpl::OvertimeLogger { … };
MixingGraphImpl::MixingGraphImpl(const media::AudioParameters& output_params,
OnMoreDataCallback on_more_data_cb,
OnErrorCallback on_error_cb)
: … { … }
MixingGraphImpl::MixingGraphImpl(const media::AudioParameters& output_params,
OnMoreDataCallback on_more_data_cb,
OnErrorCallback on_error_cb,
CreateConverterCallback create_converter_cb)
: … { … }
MixingGraphImpl::~MixingGraphImpl() { … }
std::unique_ptr<MixingGraph::Input> MixingGraphImpl::CreateInput(
const media::AudioParameters& params) { … }
media::LoopbackAudioConverter* MixingGraphImpl::FindOrAddConverter(
const media::AudioParameters& input_params,
const media::AudioParameters& output_params,
media::LoopbackAudioConverter* parent_converter) { … }
void MixingGraphImpl::AddInput(Input* input) { … }
void MixingGraphImpl::Remove(const AudioConverterKey& key,
media::AudioConverter::InputCallback* input) { … }
void MixingGraphImpl::RemoveInput(Input* input) { … }
int MixingGraphImpl::OnMoreData(base::TimeDelta delay,
base::TimeTicks delay_timestamp,
const media::AudioGlitchInfo& glitch_info,
media::AudioBus* dest) { … }
void MixingGraphImpl::OnError(ErrorType error) { … }
}