Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2463813002: Make use of new APM statistics interface. (Closed)
Patch Set: Speculative fix for bots. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/audio/audio_send_stream_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index f63cb206b5c6aaf72a4bc30b47ebd0b6c7c8680b..3be029171bb6ffda39b4d14c6c311edfce7a64c6 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -120,6 +120,16 @@ int FindNativeProcessRateToUse(int minimum_rate, bool band_splitting_required) {
return uppermost_native_rate;
}
+webrtc::AudioProcessing::Statistic FixStatistic(
+ const webrtc::AudioProcessing::Statistic& stat) {
+ webrtc::AudioProcessing::Statistic result = stat;
+ if (result.average == -100 || result.instant == -100 ||
+ result.maximum == -100 || result.minimum == -100) {
+ result.average = result.instant = result.maximum = result.minimum = -100;
+ }
+ return result;
+}
+
// Maximum length that a frame of samples can have.
static const size_t kMaxAllowedValuesOfSamplesPerFrame = 160;
// Maximum number of frames to buffer in the render queue.
@@ -1489,12 +1499,13 @@ AudioProcessing::AudioProcessingStatistics AudioProcessingImpl::GetStatistics()
EchoCancellation::Metrics metrics;
int success = public_submodules_->echo_cancellation->GetMetrics(&metrics);
if (success == Error::kNoError) {
- stats.a_nlp.Set(metrics.a_nlp);
+ stats.a_nlp.Set(FixStatistic(metrics.a_nlp));
peah-webrtc 2016/11/10 10:36:09 What you do here is basically to ensure that if an
ossu 2016/11/10 11:29:47 peah: Did you read my analysis of the problem in q
stats.divergent_filter_fraction = metrics.divergent_filter_fraction;
- stats.echo_return_loss.Set(metrics.echo_return_loss);
+ stats.echo_return_loss.Set(FixStatistic(metrics.echo_return_loss));
stats.echo_return_loss_enhancement.Set(
- metrics.echo_return_loss_enhancement);
- stats.residual_echo_return_loss.Set(metrics.residual_echo_return_loss);
+ FixStatistic(metrics.echo_return_loss_enhancement));
+ stats.residual_echo_return_loss.Set(
+ FixStatistic(metrics.residual_echo_return_loss));
}
public_submodules_->echo_cancellation->GetDelayMetrics(
&stats.delay_median, &stats.delay_standard_deviation,
« no previous file with comments | « webrtc/audio/audio_send_stream_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698