#include "modules/audio_device/audio_device_buffer.h"
#include <string.h>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include "common_audio/signal_processing/include/signal_processing_library.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/time_utils.h"
#include "rtc_base/trace_event.h"
#include "system_wrappers/include/metrics.h"
namespace webrtc {
static const char kTimerQueueName[] = …;
static const size_t kTimerIntervalInSeconds = …;
static const size_t kTimerIntervalInMilliseconds = …;
static const size_t kMinValidCallTimeTimeInSeconds = …;
static const size_t kMinValidCallTimeTimeInMilliseconds = …;
#ifdef AUDIO_DEVICE_PLAYS_SINUS_TONE
static const double k2Pi = 6.28318530717959;
#endif
AudioDeviceBuffer::AudioDeviceBuffer(TaskQueueFactory* task_queue_factory,
bool create_detached)
: … { … }
AudioDeviceBuffer::~AudioDeviceBuffer() { … }
int32_t AudioDeviceBuffer::RegisterAudioCallback(
AudioTransport* audio_callback) { … }
void AudioDeviceBuffer::StartPlayout() { … }
void AudioDeviceBuffer::StartRecording() { … }
void AudioDeviceBuffer::StopPlayout() { … }
void AudioDeviceBuffer::StopRecording() { … }
int32_t AudioDeviceBuffer::SetRecordingSampleRate(uint32_t fsHz) { … }
int32_t AudioDeviceBuffer::SetPlayoutSampleRate(uint32_t fsHz) { … }
uint32_t AudioDeviceBuffer::RecordingSampleRate() const { … }
uint32_t AudioDeviceBuffer::PlayoutSampleRate() const { … }
int32_t AudioDeviceBuffer::SetRecordingChannels(size_t channels) { … }
int32_t AudioDeviceBuffer::SetPlayoutChannels(size_t channels) { … }
size_t AudioDeviceBuffer::RecordingChannels() const { … }
size_t AudioDeviceBuffer::PlayoutChannels() const { … }
int32_t AudioDeviceBuffer::SetTypingStatus(bool typing_status) { … }
void AudioDeviceBuffer::SetVQEData(int play_delay_ms, int rec_delay_ms) { … }
int32_t AudioDeviceBuffer::SetRecordedBuffer(const void* audio_buffer,
size_t samples_per_channel) { … }
int32_t AudioDeviceBuffer::SetRecordedBuffer(
const void* audio_buffer,
size_t samples_per_channel,
absl::optional<int64_t> capture_timestamp_ns) { … }
int32_t AudioDeviceBuffer::DeliverRecordedData() { … }
int32_t AudioDeviceBuffer::RequestPlayoutData(size_t samples_per_channel) { … }
int32_t AudioDeviceBuffer::GetPlayoutData(void* audio_buffer) { … }
void AudioDeviceBuffer::StartPeriodicLogging() { … }
void AudioDeviceBuffer::StopPeriodicLogging() { … }
void AudioDeviceBuffer::LogStats(LogState state) { … }
void AudioDeviceBuffer::ResetRecStats() { … }
void AudioDeviceBuffer::ResetPlayStats() { … }
void AudioDeviceBuffer::UpdateRecStats(int16_t max_abs,
size_t samples_per_channel) { … }
void AudioDeviceBuffer::UpdatePlayStats(int16_t max_abs,
size_t samples_per_channel) { … }
}