#include "services/audio/public/cpp/audio_system_to_service_adapter.h"
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "base/trace_event/trace_event.h"
#include "media/audio/audio_device_description.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
namespace audio {
namespace {
OnAudioParamsCallback;
OnDeviceIdCallback;
OnInputDeviceInfoCallback;
OnBoolCallback;
OnDeviceDescriptionsCallback;
AudioParameters;
int64_t ToTraceId(base::TimeTicks time) { … }
std::string ParamsToString(std::optional<AudioParameters> params) { … }
enum Action { … };
enum StreamType { … };
const char* GetTraceEvent(Action action) { … }
OnAudioParamsCallback WrapGetStreamParametersReply(
StreamType stream_type,
const std::string& device_id,
OnAudioParamsCallback on_params_callback) { … }
OnBoolCallback WrapHasDevicesReply(StreamType stream_type,
OnBoolCallback on_has_devices_callback) { … }
OnDeviceDescriptionsCallback WrapGetDeviceDescriptionsReply(
StreamType stream_type,
OnDeviceDescriptionsCallback on_descriptions_callback) { … }
OnDeviceIdCallback WrapGetAssociatedOutputDeviceIDReply(
const std::string& input_device_id,
OnDeviceIdCallback on_device_id_callback) { … }
OnInputDeviceInfoCallback WrapGetInputDeviceInfoReply(
const std::string& input_device_id,
OnInputDeviceInfoCallback on_input_device_info_callback) { … }
void ReportGetDeviceDescriptionResult(bool success) { … }
}
AudioSystemToServiceAdapter::AudioSystemToServiceAdapter(
SystemInfoBinder system_info_binder,
base::TimeDelta disconnect_timeout)
: … { … }
AudioSystemToServiceAdapter::AudioSystemToServiceAdapter(
SystemInfoBinder system_info_binder)
: … { … }
AudioSystemToServiceAdapter::~AudioSystemToServiceAdapter() { … }
void AudioSystemToServiceAdapter::GetInputStreamParameters(
const std::string& device_id,
OnAudioParamsCallback on_params_callback) { … }
void AudioSystemToServiceAdapter::GetOutputStreamParameters(
const std::string& device_id,
OnAudioParamsCallback on_params_callback) { … }
void AudioSystemToServiceAdapter::HasInputDevices(
OnBoolCallback on_has_devices_callback) { … }
void AudioSystemToServiceAdapter::HasOutputDevices(
OnBoolCallback on_has_devices_callback) { … }
void AudioSystemToServiceAdapter::GetDeviceDescriptions(
bool for_input,
OnDeviceDescriptionsCallback on_descriptions_callback) { … }
void AudioSystemToServiceAdapter::GetAssociatedOutputDeviceID(
const std::string& input_device_id,
OnDeviceIdCallback on_device_id_callback) { … }
void AudioSystemToServiceAdapter::GetInputDeviceInfo(
const std::string& input_device_id,
OnInputDeviceInfoCallback on_input_device_info_callback) { … }
mojom::SystemInfo* AudioSystemToServiceAdapter::GetSystemInfo() { … }
void AudioSystemToServiceAdapter::OnConnectionError() { … }
}