Removing the use of the soon-to-be-removed echo_cancellation_impl

api function that directly returns aec_core.

BUG=webrtc:5201

Review URL: https://codereview.webrtc.org/1695743004

Cr-Commit-Position: refs/heads/master@{#11875}
This commit is contained in:
peah 2016-03-04 11:50:54 -08:00 committed by Commit bot
parent 6d8e011b64
commit 20028c49c9
3 changed files with 15 additions and 2 deletions

View File

@ -1288,10 +1288,12 @@ void AudioProcessingImpl::MaybeUpdateHistograms() {
capture_.last_stream_delay_ms = capture_nonlocked_.stream_delay_ms;
// Detect a jump in AEC system delay and log the difference.
const int frames_per_ms =
const int samples_per_ms =
rtc::CheckedDivExact(capture_nonlocked_.split_rate, 1000);
RTC_DCHECK_LT(0, samples_per_ms);
const int aec_system_delay_ms =
WebRtcAec_system_delay(echo_cancellation()->aec_core()) / frames_per_ms;
public_submodules_->echo_cancellation->GetSystemDelayInSamples() /
samples_per_ms;
const int diff_aec_system_delay_ms =
aec_system_delay_ms - capture_.last_aec_system_delay_ms;
if (diff_aec_system_delay_ms > kMinDiffDelayMs &&

View File

@ -421,6 +421,14 @@ int EchoCancellationImpl::Initialize() {
return AudioProcessing::kNoError;
}
int EchoCancellationImpl::GetSystemDelayInSamples() const {
rtc::CritScope cs(crit_capture_);
RTC_DCHECK(is_component_enabled());
// Report the delay for the first AEC component.
return WebRtcAec_system_delay(
WebRtcAec_aec_core(static_cast<Handle*>(handle(0))));
}
void EchoCancellationImpl::AllocateRenderQueue() {
const size_t new_render_queue_element_max_size = std::max<size_t>(
static_cast<size_t>(1),

View File

@ -50,6 +50,9 @@ class EchoCancellationImpl : public EchoCancellation,
// Called holding the capture lock.
void ReadQueuedRenderData();
// Returns the system delay of the first AEC component.
int GetSystemDelayInSamples() const;
private:
// EchoCancellation implementation.
int Enable(bool enable) override;