modules/audio_processing/echo_cancellation_impl.cc
// TODO(ajm): we currently just use the metrics from the first AEC. Think more
//            aboue the best way to extend this to multi-channel.
we currently just use the metrics from the first AEC. Think more
aboue the best way to extend this to multi-channel.
we currently just use the metrics from the first AEC . Think more aboue the best way to extend this to multi - channel .
int EchoCancellationImpl::GetMetrics(Metrics* metrics) {
  CriticalSectionScoped crit_scoped(crit_);
  if (metrics == NULL) {
    return apm_->kNullPointerError;
  }
  if (!is_component_enabled() || !metrics_enabled_) {
    return apm_->kNotEnabledError;
  }
  AecMetrics my_metrics;
  memset(&my_metrics, 0, sizeof(my_metrics));
  memset(metrics, 0, sizeof(Metrics));
  Handle* my_handle = static_cast<Handle*>(handle(0));
  int err = WebRtcAec_GetMetrics(my_handle, &my_metrics);
  if (err != apm_->kNoError) {
    return MapError(err);
  }
  metrics->residual_echo_return_loss.instant = my_metrics.rerl.instant;
  metrics->residual_echo_return_loss.average = my_metrics.rerl.average;
  metrics->residual_echo_return_loss.maximum = my_metrics.rerl.max;
  metrics->residual_echo_return_loss.minimum = my_metrics.rerl.min;
  metrics->echo_return_loss.instant = my_metrics.erl.instant;
  metrics->echo_return_loss.average = my_metrics.erl.average;
  metrics->echo_return_loss.maximum = my_metrics.erl.max;
  metrics->echo_return_loss.minimum = my_metrics.erl.min;
  metrics->echo_return_loss_enhancement.instant = my_metrics.erle.instant;
  metrics->echo_return_loss_enhancement.average = my_metrics.erle.average;
  metrics->echo_return_loss_enhancement.maximum = my_metrics.erle.max;
  metrics->echo_return_loss_enhancement.minimum = my_metrics.erle.min;
  metrics->a_nlp.instant = my_metrics.aNlp.instant;
  metrics->a_nlp.average = my_metrics.aNlp.average;
  metrics->a_nlp.maximum = my_metrics.aNlp.max;
  metrics->a_nlp.minimum = my_metrics.aNlp.min;
  return apm_->kNoError;
}
int EchoCancellationImpl :: GetMetrics ( Metrics * metrics ) { CriticalSectionScoped crit_scoped ( crit_ ) ; if ( metrics == NULL ) { return apm_ -> kNullPointerError ; } if ( ! is_component_enabled ( ) || ! metrics_enabled_ ) { return apm_ -> kNotEnabledError ; } AecMetrics my_metrics ; memset ( & my_metrics , 0 , sizeof ( my_metrics ) ) ; memset ( metrics , 0 , sizeof ( Metrics ) ) ; Handle * my_handle = static_cast < Handle * > ( handle ( 0 ) ) ; int err = WebRtcAec_GetMetrics ( my_handle , & my_metrics ) ; if ( err != apm_ -> kNoError ) { return MapError ( err ) ; } metrics -> residual_echo_return_loss . instant = my_metrics . rerl . instant ; metrics -> residual_echo_return_loss . average = my_metrics . rerl . average ; metrics -> residual_echo_return_loss . maximum = my_metrics . rerl . max ; metrics -> residual_echo_return_loss . minimum = my_metrics . rerl . min ; metrics -> echo_return_loss . instant = my_metrics . erl . instant ; metrics -> echo_return_loss . average = my_metrics . erl . average ; metrics -> echo_return_loss . maximum = my_metrics . erl . max ; metrics -> echo_return_loss . minimum = my_metrics . erl . min ; metrics -> echo_return_loss_enhancement . instant = my_metrics . erle . instant ; metrics -> echo_return_loss_enhancement . average = my_metrics . erle . average ; metrics -> echo_return_loss_enhancement . maximum = my_metrics . erle . max ; metrics -> echo_return_loss_enhancement . minimum = my_metrics . erle . min ; metrics -> a_nlp . instant = my_metrics . aNlp . instant ; metrics -> a_nlp . average = my_metrics . aNlp . average ; metrics -> a_nlp . maximum = my_metrics . aNlp . max ; metrics -> a_nlp . minimum = my_metrics . aNlp . min ; return apm_ -> kNoError ; }
TODO(ajm): we currently just use the metrics from the first AEC.
TODO ( ajm ) : we currently just use the metrics from the first AEC .