#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_input.h"
#include <cmath>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/task/sequenced_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "media/audio/audio_device_description.h"
#include "media/base/audio_timestamp_helper.h"
#include "third_party/blink/renderer/modules/media/audio/audio_renderer_mixer.h"
#include "third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_pool.h"
namespace blink {
constexpr base::TimeDelta kFadeInDuration = …;
AudioRendererMixerInput::AudioRendererMixerInput(
AudioRendererMixerPool* mixer_pool,
const LocalFrameToken& source_frame_token,
const FrameToken& main_frame_token,
std::string_view device_id,
media::AudioLatency::Type latency)
: … { … }
AudioRendererMixerInput::~AudioRendererMixerInput() { … }
void AudioRendererMixerInput::Initialize(
const media::AudioParameters& params,
AudioRendererSink::RenderCallback* callback) { … }
void AudioRendererMixerInput::Start() { … }
void AudioRendererMixerInput::Stop() { … }
void AudioRendererMixerInput::Play() { … }
void AudioRendererMixerInput::Pause() { … }
void AudioRendererMixerInput::Flush() { … }
bool AudioRendererMixerInput::SetVolume(double volume) { … }
media::OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() { … }
void AudioRendererMixerInput::GetOutputDeviceInfoAsync(
OutputDeviceInfoCB info_cb) { … }
bool AudioRendererMixerInput::IsOptimizedForHardwareParameters() { … }
bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() { … }
void AudioRendererMixerInput::SwitchOutputDevice(
const std::string& device_id,
media::OutputDeviceStatusCB callback) { … }
double AudioRendererMixerInput::ProvideInput(
media::AudioBus* audio_bus,
uint32_t frames_delayed,
const media::AudioGlitchInfo& glitch_info) { … }
void AudioRendererMixerInput::OnRenderError() { … }
void AudioRendererMixerInput::OnDeviceInfoReceived(
OutputDeviceInfoCB info_cb,
media::OutputDeviceInfo device_info) { … }
void AudioRendererMixerInput::OnDeviceSwitchReady(
media::OutputDeviceStatusCB switch_cb,
scoped_refptr<media::AudioRendererSink> sink,
media::OutputDeviceInfo device_info) { … }
}