#include "services/audio/input_stream.h"
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "media/audio/audio_manager.h"
#include "media/base/audio_parameters.h"
#include "media/base/user_input_monitor.h"
#include "media/mojo/mojom/audio_processing.mojom.h"
#include "mojo/public/cpp/system/buffer.h"
#include "mojo/public/cpp/system/handle.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "services/audio/input_sync_writer.h"
#include "services/audio/user_input_monitor.h"
#include "third_party/abseil-cpp/absl/utility/utility.h"
namespace audio {
namespace {
const int kMaxInputChannels = …;
InputStreamErrorCode;
DisconnectReason;
const char* ErrorCodeToString(InputController::ErrorCode error) { … }
std::string GetCtorLogString(const std::string& device_id,
const media::AudioParameters& params,
bool enable_agc) { … }
}
InputStream::InputStream(
CreatedCallback created_callback,
DeleteCallback delete_callback,
mojo::PendingReceiver<media::mojom::AudioInputStream> receiver,
mojo::PendingRemote<media::mojom::AudioInputStreamClient> client,
mojo::PendingRemote<media::mojom::AudioInputStreamObserver> observer,
mojo::PendingRemote<media::mojom::AudioLog> log,
media::AudioManager* audio_manager,
media::AecdumpRecordingManager* aecdump_recording_manager,
std::unique_ptr<UserInputMonitor> user_input_monitor,
DeviceOutputListener* device_output_listener,
media::mojom::AudioProcessingConfigPtr processing_config,
const std::string& device_id,
const media::AudioParameters& params,
uint32_t shared_memory_count,
bool enable_agc)
: … { … }
InputStream::~InputStream() { … }
void InputStream::SetOutputDeviceForAec(const std::string& output_device_id) { … }
void InputStream::Record() { … }
void InputStream::SetVolume(double volume) { … }
void InputStream::OnCreated(bool initially_muted) { … }
DisconnectReason InputErrorToDisconnectReason(InputController::ErrorCode code) { … }
InputStreamErrorCode InputControllerErrorToStreamError(
InputController::ErrorCode code) { … }
void InputStream::OnError(InputController::ErrorCode error_code) { … }
void InputStream::OnLog(std::string_view message) { … }
void InputStream::OnMuted(bool is_muted) { … }
void InputStream::OnStreamPlatformError() { … }
void InputStream::OnStreamError(
std::optional<DisconnectReason> reason_to_report) { … }
void InputStream::CallDeleter() { … }
void InputStream::SendLogMessage(const char* format, ...) { … }
}