#include "third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_manager.h"
#include <limits>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/ranges/algorithm.h"
#include "base/types/cxx23_to_underlying.h"
#include "build/build_config.h"
#include "media/audio/audio_device_description.h"
#include "media/base/audio_renderer_sink.h"
#include "media/base/media_switches.h"
#include "third_party/blink/public/web/modules/media/audio/audio_device_factory.h"
#include "third_party/blink/renderer/modules/media/audio/audio_renderer_mixer.h"
#include "third_party/blink/renderer/modules/media/audio/audio_renderer_mixer_input.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
namespace {
media::AudioParameters GetMixerOutputParams(
const media::AudioParameters& input_params,
const media::AudioParameters& hardware_params,
media::AudioLatency::Type latency) { … }
}
namespace blink {
AudioRendererMixerManager::AudioRendererMixerManager(
CreateSinkCB create_sink_cb)
: … { … }
AudioRendererMixerManager::~AudioRendererMixerManager() { … }
scoped_refptr<AudioRendererMixerInput> AudioRendererMixerManager::CreateInput(
const LocalFrameToken& source_frame_token,
const FrameToken& main_frame_token,
const base::UnguessableToken& session_id,
std::string_view device_id,
media::AudioLatency::Type latency) { … }
AudioRendererMixer* AudioRendererMixerManager::GetMixer(
const FrameToken& main_frame_token,
const media::AudioParameters& input_params,
media::AudioLatency::Type latency,
const media::OutputDeviceInfo& sink_info,
scoped_refptr<media::AudioRendererSink> sink) { … }
void AudioRendererMixerManager::ReturnMixer(AudioRendererMixer* mixer) { … }
scoped_refptr<media::AudioRendererSink> AudioRendererMixerManager::GetSink(
const LocalFrameToken& source_frame_token,
std::string_view device_id) { … }
AudioRendererMixerManager::MixerKey::MixerKey(
const FrameToken& main_frame_token,
const media::AudioParameters& params,
media::AudioLatency::Type latency,
std::string_view device_id)
: … { … }
AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default;
AudioRendererMixerManager::MixerKey::~MixerKey() = default;
}