#include "modules/audio_processing/aec3/render_delay_buffer.h"
#include <string.h>
#include <algorithm>
#include <atomic>
#include <cmath>
#include <memory>
#include <numeric>
#include <vector>
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "api/audio/echo_canceller3_config.h"
#include "modules/audio_processing/aec3/aec3_common.h"
#include "modules/audio_processing/aec3/aec3_fft.h"
#include "modules/audio_processing/aec3/alignment_mixer.h"
#include "modules/audio_processing/aec3/block_buffer.h"
#include "modules/audio_processing/aec3/decimator.h"
#include "modules/audio_processing/aec3/downsampled_render_buffer.h"
#include "modules/audio_processing/aec3/fft_buffer.h"
#include "modules/audio_processing/aec3/fft_data.h"
#include "modules/audio_processing/aec3/render_buffer.h"
#include "modules/audio_processing/aec3/spectrum_buffer.h"
#include "modules/audio_processing/logging/apm_data_dumper.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/field_trial.h"
namespace webrtc {
namespace {
class RenderDelayBufferImpl final : public RenderDelayBuffer { … };
std::atomic<int> RenderDelayBufferImpl::instance_count_ = …;
RenderDelayBufferImpl::RenderDelayBufferImpl(const EchoCanceller3Config& config,
int sample_rate_hz,
size_t num_render_channels)
: … { … }
RenderDelayBufferImpl::~RenderDelayBufferImpl() = default;
void RenderDelayBufferImpl::Reset() { … }
RenderDelayBuffer::BufferingEvent RenderDelayBufferImpl::Insert(
const Block& block) { … }
void RenderDelayBufferImpl::HandleSkippedCaptureProcessing() { … }
RenderDelayBuffer::BufferingEvent
RenderDelayBufferImpl::PrepareCaptureProcessing() { … }
bool RenderDelayBufferImpl::AlignFromDelay(size_t delay) { … }
void RenderDelayBufferImpl::SetAudioBufferDelay(int delay_ms) { … }
bool RenderDelayBufferImpl::HasReceivedBufferDelay() { … }
int RenderDelayBufferImpl::MapDelayToTotalDelay(
size_t external_delay_blocks) const { … }
int RenderDelayBufferImpl::ComputeDelay() const { … }
void RenderDelayBufferImpl::ApplyTotalDelay(int delay) { … }
void RenderDelayBufferImpl::AlignFromExternalDelay() { … }
void RenderDelayBufferImpl::InsertBlock(const Block& block,
int previous_write) { … }
bool RenderDelayBufferImpl::DetectActiveRender(
rtc::ArrayView<const float> x) const { … }
bool RenderDelayBufferImpl::DetectExcessRenderBlocks() { … }
int RenderDelayBufferImpl::BufferLatency() const { … }
void RenderDelayBufferImpl::IncrementWriteIndices() { … }
void RenderDelayBufferImpl::IncrementLowRateReadIndices() { … }
void RenderDelayBufferImpl::IncrementReadIndices() { … }
bool RenderDelayBufferImpl::RenderOverrun() { … }
bool RenderDelayBufferImpl::RenderUnderrun() { … }
}
RenderDelayBuffer* RenderDelayBuffer::Create(const EchoCanceller3Config& config,
int sample_rate_hz,
size_t num_render_channels) { … }
}