From 2a8a78c905a68935d2ff53355982601e2e083dfa Mon Sep 17 00:00:00 2001 From: Minyue Date: Thu, 7 Apr 2016 16:48:15 +0200 Subject: [PATCH] Add AEC filter divergence metric to StatsCollector. A new metric that tells how often the AEC linear filter diverges has been recently introduced, see https://codereview.webrtc.org/1739993003/ This metric can reflect echo failure and ducking. In this CL, we add a field in StatsCollector to receive this metric. BUG= R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1866983002 . Cr-Commit-Position: refs/heads/master@{#12282} --- webrtc/api/mediastreaminterface.h | 4 +++- webrtc/api/statscollector.cc | 3 +++ webrtc/api/statstypes.cc | 2 ++ webrtc/api/statstypes.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/webrtc/api/mediastreaminterface.h b/webrtc/api/mediastreaminterface.h index 2a3f3473b0..57c0776a32 100644 --- a/webrtc/api/mediastreaminterface.h +++ b/webrtc/api/mediastreaminterface.h @@ -215,7 +215,8 @@ class AudioProcessorInterface : public rtc::RefCountInterface { echo_return_loss_enhancement(0), echo_delay_median_ms(0), aec_quality_min(0.0), - echo_delay_std_ms(0) {} + echo_delay_std_ms(0), + aec_divergent_filter_fraction(0.0) {} ~AudioProcessorStats() {} bool typing_noise_detected; @@ -224,6 +225,7 @@ class AudioProcessorInterface : public rtc::RefCountInterface { int echo_delay_median_ms; float aec_quality_min; int echo_delay_std_ms; + float aec_divergent_filter_fraction; }; // Get audio processor statistics. diff --git a/webrtc/api/statscollector.cc b/webrtc/api/statscollector.cc index 0901fc61b1..38fb5fb7db 100644 --- a/webrtc/api/statscollector.cc +++ b/webrtc/api/statscollector.cc @@ -937,6 +937,9 @@ void StatsCollector::UpdateReportFromAudioTrack(AudioTrackInterface* track, report, stats.typing_noise_detected, stats.echo_return_loss, stats.echo_return_loss_enhancement, stats.echo_delay_median_ms, stats.aec_quality_min, stats.echo_delay_std_ms); + + report->AddFloat(StatsReport::kStatsValueNameAecDivergentFilterFraction, + stats.aec_divergent_filter_fraction); } } diff --git a/webrtc/api/statstypes.cc b/webrtc/api/statstypes.cc index feeead4374..61af82467a 100644 --- a/webrtc/api/statstypes.cc +++ b/webrtc/api/statstypes.cc @@ -363,6 +363,8 @@ bool StatsReport::Value::bool_val() const { const char* StatsReport::Value::display_name() const { switch (name) { + case kStatsValueNameAecDivergentFilterFraction: + return "aecDivergentFilterFraction"; case kStatsValueNameAudioOutputLevel: return "audioOutputLevel"; case kStatsValueNameAudioInputLevel: diff --git a/webrtc/api/statstypes.h b/webrtc/api/statstypes.h index 9a44724e8f..7efd0fe38a 100644 --- a/webrtc/api/statstypes.h +++ b/webrtc/api/statstypes.h @@ -99,6 +99,7 @@ class StatsReport { enum StatsValueName { kStatsValueNameActiveConnection, + kStatsValueNameAecDivergentFilterFraction, kStatsValueNameAudioInputLevel, kStatsValueNameAudioOutputLevel, kStatsValueNameBytesReceived,