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

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

Issue 2456333002: Revert of New statistics interface for APM (Closed)
Patch Set: 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);
450 public_submodules_->echo_control_mobile->Initialize( 446 public_submodules_->echo_control_mobile->Initialize(
451 proc_split_sample_rate_hz(), num_reverse_channels(), 447 proc_split_sample_rate_hz(), num_reverse_channels(),
452 num_output_channels()); 448 num_output_channels());
453 if (constants_.use_experimental_agc) { 449 if (constants_.use_experimental_agc) {
454 if (!private_submodules_->agc_manager.get()) { 450 if (!private_submodules_->agc_manager.get()) {
455 private_submodules_->agc_manager.reset(new AgcManagerDirect( 451 private_submodules_->agc_manager.reset(new AgcManagerDirect(
456 public_submodules_->gain_control.get(), 452 public_submodules_->gain_control.get(),
457 public_submodules_->gain_control_for_experimental_agc.get(), 453 public_submodules_->gain_control_for_experimental_agc.get(),
458 constants_.agc_startup_min_volume)); 454 constants_.agc_startup_min_volume));
459 } 455 }
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 1410
1415 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP 1411 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
1416 // We just return if recording hasn't started. 1412 // We just return if recording hasn't started.
1417 debug_dump_.debug_file->CloseFile(); 1413 debug_dump_.debug_file->CloseFile();
1418 return kNoError; 1414 return kNoError;
1419 #else 1415 #else
1420 return kUnsupportedFunctionError; 1416 return kUnsupportedFunctionError;
1421 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1417 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1422 } 1418 }
1423 1419
1424 AudioProcessing::AudioProcessingStatistics AudioProcessingImpl::GetStatistics()
1425 const {
1426 AudioProcessingStatistics stats;
1427 EchoCancellation::Metrics metrics;
1428 public_submodules_->echo_cancellation->GetMetrics(&metrics);
1429 stats.a_nlp.Set(metrics.a_nlp);
1430 stats.divergent_filter_fraction = metrics.divergent_filter_fraction;
1431 stats.echo_return_loss.Set(metrics.echo_return_loss);
1432 stats.echo_return_loss_enhancement.Set(metrics.echo_return_loss_enhancement);
1433 stats.residual_echo_return_loss.Set(metrics.residual_echo_return_loss);
1434 public_submodules_->echo_cancellation->GetDelayMetrics(
1435 &stats.delay_median, &stats.delay_standard_deviation,
1436 &stats.fraction_poor_delays);
1437 return stats;
1438 }
1439
1440 EchoCancellation* AudioProcessingImpl::echo_cancellation() const { 1420 EchoCancellation* AudioProcessingImpl::echo_cancellation() const {
1441 return public_submodules_->echo_cancellation.get(); 1421 return public_submodules_->echo_cancellation.get();
1442 } 1422 }
1443 1423
1444 EchoControlMobile* AudioProcessingImpl::echo_control_mobile() const { 1424 EchoControlMobile* AudioProcessingImpl::echo_control_mobile() const {
1445 return public_submodules_->echo_control_mobile.get(); 1425 return public_submodules_->echo_control_mobile.get();
1446 } 1426 }
1447 1427
1448 GainControl* AudioProcessingImpl::gain_control() const { 1428 GainControl* AudioProcessingImpl::gain_control() const {
1449 if (constants_.use_experimental_agc) { 1429 if (constants_.use_experimental_agc) {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 capture_processing_format(kSampleRate16kHz), 1733 capture_processing_format(kSampleRate16kHz),
1754 split_rate(kSampleRate16kHz) {} 1734 split_rate(kSampleRate16kHz) {}
1755 1735
1756 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1736 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1757 1737
1758 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1738 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1759 1739
1760 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1740 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1761 1741
1762 } // namespace webrtc 1742 } // 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