#include "third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc.h"
#include <utility>
#include "base/metrics/histogram_macros.h"
#include "base/task/single_thread_task_runner.h"
#include "media/audio/audio_device_description.h"
#include "media/mojo/mojom/audio_output_stream.mojom-blink.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
void TrivialAuthorizedCallback(media::mojom::blink::OutputDeviceStatus,
const media::AudioParameters&,
const String&) { … }
}
MojoAudioOutputIPC::MojoAudioOutputIPC(
FactoryAccessorCB factory_accessor,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
: … { … }
MojoAudioOutputIPC::~MojoAudioOutputIPC() { … }
void MojoAudioOutputIPC::RequestDeviceAuthorization(
media::AudioOutputIPCDelegate* delegate,
const base::UnguessableToken& session_id,
const std::string& device_id) { … }
void MojoAudioOutputIPC::CreateStream(media::AudioOutputIPCDelegate* delegate,
const media::AudioParameters& params) { … }
void MojoAudioOutputIPC::PlayStream() { … }
void MojoAudioOutputIPC::PauseStream() { … }
void MojoAudioOutputIPC::FlushStream() { … }
void MojoAudioOutputIPC::CloseStream() { … }
void MojoAudioOutputIPC::SetVolume(double volume) { … }
void MojoAudioOutputIPC::ProviderClientBindingDisconnected(
uint32_t disconnect_reason,
const std::string& description) { … }
bool MojoAudioOutputIPC::AuthorizationRequested() const { … }
bool MojoAudioOutputIPC::StreamCreationRequested() const { … }
mojo::PendingReceiver<media::mojom::blink::AudioOutputStreamProvider>
MojoAudioOutputIPC::MakeProviderReceiver() { … }
void MojoAudioOutputIPC::DoRequestDeviceAuthorization(
const base::UnguessableToken& session_id,
const std::string& device_id,
AuthorizationCB callback) { … }
void MojoAudioOutputIPC::ReceivedDeviceAuthorization(
base::TimeTicks auth_start_time,
media::mojom::blink::OutputDeviceStatus status,
const media::AudioParameters& params,
const String& device_id) const { … }
void MojoAudioOutputIPC::Created(
mojo::PendingRemote<media::mojom::blink::AudioOutputStream> pending_stream,
media::mojom::blink::ReadWriteAudioDataPipePtr data_pipe) { … }
}