#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/audio/alsa/alsa_input.h"
#include <stddef.h>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/task/single_thread_task_runner.h"
#include "media/audio/alsa/alsa_output.h"
#include "media/audio/alsa/alsa_util.h"
#include "media/audio/alsa/alsa_wrapper.h"
#include "media/audio/alsa/audio_manager_alsa.h"
#include "media/audio/audio_manager.h"
namespace media {
static const SampleFormat kSampleFormat = …;
static const snd_pcm_format_t kAlsaSampleFormat = …;
static const int kNumPacketsInRingBuffer = …;
static const char kDefaultDevice1[] = …;
static const char kDefaultDevice2[] = …;
const char AlsaPcmInputStream::kAutoSelectDevice[] = …;
AlsaPcmInputStream::AlsaPcmInputStream(AudioManagerBase* audio_manager,
const std::string& device_name,
const AudioParameters& params,
AlsaWrapper* wrapper)
: … { … }
AlsaPcmInputStream::~AlsaPcmInputStream() = default;
AudioInputStream::OpenOutcome AlsaPcmInputStream::Open() { … }
void AlsaPcmInputStream::Start(AudioInputCallback* callback) { … }
bool AlsaPcmInputStream::Recover(int original_error) { … }
void AlsaPcmInputStream::StopRunningOnCaptureThread() { … }
void AlsaPcmInputStream::ReadAudio() { … }
void AlsaPcmInputStream::Stop() { … }
void AlsaPcmInputStream::Close() { … }
double AlsaPcmInputStream::GetMaxVolume() { … }
void AlsaPcmInputStream::SetVolume(double volume) { … }
double AlsaPcmInputStream::GetVolume() { … }
bool AlsaPcmInputStream::IsMuted() { … }
void AlsaPcmInputStream::SetOutputDeviceForAec(
const std::string& output_device_id) { … }
void AlsaPcmInputStream::HandleError(const char* method, int error) { … }
}