#include "media/audio/audio_output_device.h"
#include <stddef.h>
#include <stdint.h>
#include <cmath>
#include <memory>
#include <utility>
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/timer/timer.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "media/audio/audio_device_description.h"
#include "media/audio/audio_output_device_thread_callback.h"
#include "media/base/limits.h"
namespace media {
AudioOutputDevice::AudioOutputDevice(
std::unique_ptr<AudioOutputIPC> ipc,
const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
const AudioSinkParameters& sink_params,
base::TimeDelta authorization_timeout)
: … { … }
void AudioOutputDevice::Initialize(const AudioParameters& params,
RenderCallback* callback) { … }
void AudioOutputDevice::InitializeOnIOThread(
const AudioParameters& params,
MayBeDangling<RenderCallback> callback) { … }
AudioOutputDevice::~AudioOutputDevice() { … }
void AudioOutputDevice::RequestDeviceAuthorization() { … }
void AudioOutputDevice::Start() { … }
void AudioOutputDevice::Stop() { … }
void AudioOutputDevice::Play() { … }
void AudioOutputDevice::Pause() { … }
void AudioOutputDevice::Flush() { … }
bool AudioOutputDevice::SetVolume(double volume) { … }
OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo() { … }
void AudioOutputDevice::GetOutputDeviceInfoAsync(OutputDeviceInfoCB info_cb) { … }
bool AudioOutputDevice::IsOptimizedForHardwareParameters() { … }
bool AudioOutputDevice::CurrentThreadIsRenderingThread() { … }
void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() { … }
void AudioOutputDevice::CreateStreamOnIOThread() { … }
void AudioOutputDevice::PlayOnIOThread() { … }
void AudioOutputDevice::PauseOnIOThread() { … }
void AudioOutputDevice::FlushOnIOThread() { … }
void AudioOutputDevice::ShutDownOnIOThread() { … }
void AudioOutputDevice::SetVolumeOnIOThread(double volume) { … }
void AudioOutputDevice::OnError() { … }
void AudioOutputDevice::OnDeviceAuthorized(
OutputDeviceStatus device_status,
const AudioParameters& output_params,
const std::string& matched_device_id) { … }
void AudioOutputDevice::OnStreamCreated(
base::UnsafeSharedMemoryRegion shared_memory_region,
base::SyncSocket::ScopedHandle socket_handle,
bool playing_automatically) { … }
void AudioOutputDevice::OnIPCClosed() { … }
OutputDeviceInfo AudioOutputDevice::GetOutputDeviceInfo_Signaled() { … }
void AudioOutputDevice::OnAuthSignal() { … }
void AudioOutputDevice::NotifyRenderCallbackOfError() { … }
}