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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2433153003: New statistics interface for APM (Closed)
Patch Set: Created 4 years, 2 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 1271
1272 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 1272 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
1273 // We just return if recording hasn't started. 1273 // We just return if recording hasn't started.
1274 debug_dump_.debug_file->CloseFile(); 1274 debug_dump_.debug_file->CloseFile();
1275 return kNoError; 1275 return kNoError;
1276 #else 1276 #else
1277 return kUnsupportedFunctionError; 1277 return kUnsupportedFunctionError;
1278 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1278 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1279 } 1279 }
1280 1280
1281 void AudioProcessingImpl::SetStatisticsEnabled(bool enabled) {
1282 int success = public_submodules_->echo_cancellation->enable_metrics(enabled);
1283 RTC_DCHECK_EQ(0, success);
1284 success =
1285 public_submodules_->echo_cancellation->enable_delay_logging(enabled);
1286 RTC_DCHECK_EQ(0, success);
1287 }
1288
1289 void AudioProcessingImpl::GetStatistics(
1290 AudioProcessingStatistics* stats) const {
1291 RTC_DCHECK(stats);
1292 EchoCancellation::Metrics metrics;
1293 public_submodules_->echo_cancellation->GetMetrics(&metrics);
1294 stats->a_nlp = metrics.a_nlp;
1295 stats->divergent_filter_fraction = metrics.divergent_filter_fraction;
1296 stats->echo_return_loss = metrics.echo_return_loss;
1297 stats->echo_return_loss_enhancement = metrics.echo_return_loss_enhancement;
1298 stats->residual_echo_return_loss = metrics.residual_echo_return_loss;
1299 public_submodules_->echo_cancellation->GetDelayMetrics(
1300 &stats->delay_median, &stats->delay_standard_deviation,
1301 &stats->fraction_poor_delays);
1302 }
1303
1281 EchoCancellation* AudioProcessingImpl::echo_cancellation() const { 1304 EchoCancellation* AudioProcessingImpl::echo_cancellation() const {
1282 return public_submodules_->echo_cancellation.get(); 1305 return public_submodules_->echo_cancellation.get();
1283 } 1306 }
1284 1307
1285 EchoControlMobile* AudioProcessingImpl::echo_control_mobile() const { 1308 EchoControlMobile* AudioProcessingImpl::echo_control_mobile() const {
1286 return public_submodules_->echo_control_mobile.get(); 1309 return public_submodules_->echo_control_mobile.get();
1287 } 1310 }
1288 1311
1289 GainControl* AudioProcessingImpl::gain_control() const { 1312 GainControl* AudioProcessingImpl::gain_control() const {
1290 if (constants_.use_experimental_agc) { 1313 if (constants_.use_experimental_agc) {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 capture_processing_format(kSampleRate16kHz), 1617 capture_processing_format(kSampleRate16kHz),
1595 split_rate(kSampleRate16kHz) {} 1618 split_rate(kSampleRate16kHz) {}
1596 1619
1597 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1620 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1598 1621
1599 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1622 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1600 1623
1601 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1624 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1602 1625
1603 } // namespace webrtc 1626 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698