APM reports AEC3 ERL and ERLE metrics also via the old GetStatistics function.

The audio processing module reports the metrics 'echo return loss'
and 'echo return loss enhancement' for AEC3 via the old, soon to be
replaced, GetStatistics fuction.

Bug: webrtc:8533
Change-Id: I6b2286b5cdf8f20ebf14f82f1180f6bfb6c00c68
Reviewed-on: https://webrtc-review.googlesource.com/25642
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20869}
This commit is contained in:
Gustaf Ullberg
2017-11-24 13:42:29 +01:00
committed by Commit Bot
parent 81af414ffb
commit 09b9faed53

View File

@ -1580,7 +1580,15 @@ AudioProcessing::AudioProcessingStatistics AudioProcessingImpl::GetStatistics()
const {
AudioProcessingStatistics stats;
EchoCancellation::Metrics metrics;
if (public_submodules_->echo_cancellation->GetMetrics(&metrics) ==
if (private_submodules_->echo_controller) {
rtc::CritScope cs_capture(&crit_capture_);
auto ec_metrics = private_submodules_->echo_controller->GetMetrics();
float erl = static_cast<float>(ec_metrics.echo_return_loss);
float erle = static_cast<float>(ec_metrics.echo_return_loss_enhancement);
// Instant value will also be used for min, max and average.
stats.echo_return_loss.Set(erl, erl, erl, erl);
stats.echo_return_loss_enhancement.Set(erle, erle, erle, erle);
} else if (public_submodules_->echo_cancellation->GetMetrics(&metrics) ==
Error::kNoError) {
stats.a_nlp.Set(metrics.a_nlp);
stats.divergent_filter_fraction = metrics.divergent_filter_fraction;
@ -1610,12 +1618,10 @@ AudioProcessing::AudioProcessingStats AudioProcessingImpl::GetStatistics(
EchoCancellation::Metrics metrics;
if (private_submodules_->echo_controller) {
rtc::CritScope cs_capture(&crit_capture_);
EchoControl::Metrics ec_metrics =
private_submodules_->echo_controller->GetMetrics();
stats.echo_return_loss =
rtc::Optional<double>(ec_metrics.echo_return_loss);
auto ec_metrics = private_submodules_->echo_controller->GetMetrics();
stats.echo_return_loss = ec_metrics.echo_return_loss;
stats.echo_return_loss_enhancement =
rtc::Optional<double>(ec_metrics.echo_return_loss_enhancement);
ec_metrics.echo_return_loss_enhancement;
} else if (public_submodules_->echo_cancellation->GetMetrics(&metrics) ==
Error::kNoError) {
if (metrics.divergent_filter_fraction != -1.0f) {