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

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

Issue 2458993002: Reland of New statistics interface for APM (Closed)
Patch Set: Added implementation of the new non-pure interface function. 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 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 formats_.api_format.output_stream().num_frames())); 436 formats_.api_format.output_stream().num_frames()));
437 437
438 public_submodules_->gain_control->Initialize(num_proc_channels(), 438 public_submodules_->gain_control->Initialize(num_proc_channels(),
439 proc_sample_rate_hz()); 439 proc_sample_rate_hz());
440 440
441 public_submodules_->echo_cancellation->Initialize( 441 public_submodules_->echo_cancellation->Initialize(
442 proc_sample_rate_hz(), num_reverse_channels(), num_output_channels(), 442 proc_sample_rate_hz(), num_reverse_channels(), num_output_channels(),
443 num_proc_channels()); 443 num_proc_channels());
444 AllocateRenderQueue(); 444 AllocateRenderQueue();
445 445
446 int success = public_submodules_->echo_cancellation->enable_metrics(true);
447 RTC_DCHECK_EQ(0, success);
448 success = public_submodules_->echo_cancellation->enable_delay_logging(true);
449 RTC_DCHECK_EQ(0, success);
446 public_submodules_->echo_control_mobile->Initialize( 450 public_submodules_->echo_control_mobile->Initialize(
447 proc_split_sample_rate_hz(), num_reverse_channels(), 451 proc_split_sample_rate_hz(), num_reverse_channels(),
448 num_output_channels()); 452 num_output_channels());
449 if (constants_.use_experimental_agc) { 453 if (constants_.use_experimental_agc) {
450 if (!private_submodules_->agc_manager.get()) { 454 if (!private_submodules_->agc_manager.get()) {
451 private_submodules_->agc_manager.reset(new AgcManagerDirect( 455 private_submodules_->agc_manager.reset(new AgcManagerDirect(
452 public_submodules_->gain_control.get(), 456 public_submodules_->gain_control.get(),
453 public_submodules_->gain_control_for_experimental_agc.get(), 457 public_submodules_->gain_control_for_experimental_agc.get(),
454 constants_.agc_startup_min_volume)); 458 constants_.agc_startup_min_volume));
455 } 459 }
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 1414
1411 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 1415 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
1412 // We just return if recording hasn't started. 1416 // We just return if recording hasn't started.
1413 debug_dump_.debug_file->CloseFile(); 1417 debug_dump_.debug_file->CloseFile();
1414 return kNoError; 1418 return kNoError;
1415 #else 1419 #else
1416 return kUnsupportedFunctionError; 1420 return kUnsupportedFunctionError;
1417 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1421 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1418 } 1422 }
1419 1423
1424 // TODO(ivoc): Remove this when GetStatistics() becomes pure virtual.
1425 AudioProcessing::AudioProcessingStatistics AudioProcessing::GetStatistics()
1426 const {
1427 return AudioProcessingStatistics();
1428 }
1429
1430 AudioProcessing::AudioProcessingStatistics AudioProcessingImpl::GetStatistics()
1431 const {
1432 AudioProcessingStatistics stats;
1433 EchoCancellation::Metrics metrics;
1434 public_submodules_->echo_cancellation->GetMetrics(&metrics);
1435 stats.a_nlp.Set(metrics.a_nlp);
1436 stats.divergent_filter_fraction = metrics.divergent_filter_fraction;
1437 stats.echo_return_loss.Set(metrics.echo_return_loss);
1438 stats.echo_return_loss_enhancement.Set(metrics.echo_return_loss_enhancement);
1439 stats.residual_echo_return_loss.Set(metrics.residual_echo_return_loss);
1440 public_submodules_->echo_cancellation->GetDelayMetrics(
1441 &stats.delay_median, &stats.delay_standard_deviation,
1442 &stats.fraction_poor_delays);
1443 return stats;
1444 }
1445
1420 EchoCancellation* AudioProcessingImpl::echo_cancellation() const { 1446 EchoCancellation* AudioProcessingImpl::echo_cancellation() const {
1421 return public_submodules_->echo_cancellation.get(); 1447 return public_submodules_->echo_cancellation.get();
1422 } 1448 }
1423 1449
1424 EchoControlMobile* AudioProcessingImpl::echo_control_mobile() const { 1450 EchoControlMobile* AudioProcessingImpl::echo_control_mobile() const {
1425 return public_submodules_->echo_control_mobile.get(); 1451 return public_submodules_->echo_control_mobile.get();
1426 } 1452 }
1427 1453
1428 GainControl* AudioProcessingImpl::gain_control() const { 1454 GainControl* AudioProcessingImpl::gain_control() const {
1429 if (constants_.use_experimental_agc) { 1455 if (constants_.use_experimental_agc) {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 capture_processing_format(kSampleRate16kHz), 1759 capture_processing_format(kSampleRate16kHz),
1734 split_rate(kSampleRate16kHz) {} 1760 split_rate(kSampleRate16kHz) {}
1735 1761
1736 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1762 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1737 1763
1738 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1764 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1739 1765
1740 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1766 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1741 1767
1742 } // namespace webrtc 1768 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.h ('k') | webrtc/modules/audio_processing/audio_processing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698