| OLD | NEW |
| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config) | 296 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config) |
| 297 : AudioProcessingImpl(config, nullptr) {} | 297 : AudioProcessingImpl(config, nullptr) {} |
| 298 | 298 |
| 299 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config, | 299 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config, |
| 300 NonlinearBeamformer* beamformer) | 300 NonlinearBeamformer* beamformer) |
| 301 : high_pass_filter_impl_(new HighPassFilterImpl(this)), | 301 : high_pass_filter_impl_(new HighPassFilterImpl(this)), |
| 302 public_submodules_(new ApmPublicSubmodules()), | 302 public_submodules_(new ApmPublicSubmodules()), |
| 303 private_submodules_(new ApmPrivateSubmodules(beamformer)), | 303 private_submodules_(new ApmPrivateSubmodules(beamformer)), |
| 304 constants_(config.Get<ExperimentalAgc>().startup_min_volume, | 304 constants_(config.Get<ExperimentalAgc>().startup_min_volume, |
| 305 config.Get<ExperimentalAgc>().clipped_level_min, |
| 305 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 306 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 306 false), | 307 false), |
| 307 #else | 308 #else |
| 308 config.Get<ExperimentalAgc>().enabled), | 309 config.Get<ExperimentalAgc>().enabled), |
| 309 #endif | 310 #endif |
| 310 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 311 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 311 capture_(false, | 312 capture_(false, |
| 312 #else | 313 #else |
| 313 capture_(config.Get<ExperimentalNs>().enabled, | 314 capture_(config.Get<ExperimentalNs>().enabled, |
| 314 #endif | 315 #endif |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 proc_split_sample_rate_hz(), num_reverse_channels(), | 482 proc_split_sample_rate_hz(), num_reverse_channels(), |
| 482 num_output_channels()); | 483 num_output_channels()); |
| 483 | 484 |
| 484 public_submodules_->gain_control->Initialize(num_proc_channels(), | 485 public_submodules_->gain_control->Initialize(num_proc_channels(), |
| 485 proc_sample_rate_hz()); | 486 proc_sample_rate_hz()); |
| 486 if (constants_.use_experimental_agc) { | 487 if (constants_.use_experimental_agc) { |
| 487 if (!private_submodules_->agc_manager.get()) { | 488 if (!private_submodules_->agc_manager.get()) { |
| 488 private_submodules_->agc_manager.reset(new AgcManagerDirect( | 489 private_submodules_->agc_manager.reset(new AgcManagerDirect( |
| 489 public_submodules_->gain_control.get(), | 490 public_submodules_->gain_control.get(), |
| 490 public_submodules_->gain_control_for_experimental_agc.get(), | 491 public_submodules_->gain_control_for_experimental_agc.get(), |
| 491 constants_.agc_startup_min_volume)); | 492 constants_.agc_startup_min_volume, constants_.agc_clipped_level_min)); |
| 492 } | 493 } |
| 493 private_submodules_->agc_manager->Initialize(); | 494 private_submodules_->agc_manager->Initialize(); |
| 494 private_submodules_->agc_manager->SetCaptureMuted( | 495 private_submodules_->agc_manager->SetCaptureMuted( |
| 495 capture_.output_will_be_muted); | 496 capture_.output_will_be_muted); |
| 496 public_submodules_->gain_control_for_experimental_agc->Initialize(); | 497 public_submodules_->gain_control_for_experimental_agc->Initialize(); |
| 497 } | 498 } |
| 498 InitializeTransient(); | 499 InitializeTransient(); |
| 499 InitializeBeamformer(); | 500 InitializeBeamformer(); |
| 500 #if WEBRTC_INTELLIGIBILITY_ENHANCER | 501 #if WEBRTC_INTELLIGIBILITY_ENHANCER |
| 501 InitializeIntelligibility(); | 502 InitializeIntelligibility(); |
| (...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 config.set_intelligibility_enhancer_enabled( | 1847 config.set_intelligibility_enhancer_enabled( |
| 1847 capture_nonlocked_.intelligibility_enabled); | 1848 capture_nonlocked_.intelligibility_enabled); |
| 1848 | 1849 |
| 1849 std::string experiments_description = | 1850 std::string experiments_description = |
| 1850 public_submodules_->echo_cancellation->GetExperimentsDescription(); | 1851 public_submodules_->echo_cancellation->GetExperimentsDescription(); |
| 1851 // TODO(peah): Add semicolon-separated concatenations of experiment | 1852 // TODO(peah): Add semicolon-separated concatenations of experiment |
| 1852 // descriptions for other submodules. | 1853 // descriptions for other submodules. |
| 1853 if (capture_nonlocked_.level_controller_enabled) { | 1854 if (capture_nonlocked_.level_controller_enabled) { |
| 1854 experiments_description += "LevelController;"; | 1855 experiments_description += "LevelController;"; |
| 1855 } | 1856 } |
| 1857 if (constants_.agc_clipped_level_min != kClippedLevelMin) { |
| 1858 experiments_description += "AgcClippingLevelExperiment;"; |
| 1859 } |
| 1856 config.set_experiments_description(experiments_description); | 1860 config.set_experiments_description(experiments_description); |
| 1857 | 1861 |
| 1858 std::string serialized_config = config.SerializeAsString(); | 1862 std::string serialized_config = config.SerializeAsString(); |
| 1859 if (!forced && | 1863 if (!forced && |
| 1860 debug_dump_.capture.last_serialized_config == serialized_config) { | 1864 debug_dump_.capture.last_serialized_config == serialized_config) { |
| 1861 return kNoError; | 1865 return kNoError; |
| 1862 } | 1866 } |
| 1863 | 1867 |
| 1864 debug_dump_.capture.last_serialized_config = serialized_config; | 1868 debug_dump_.capture.last_serialized_config = serialized_config; |
| 1865 | 1869 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1891 capture_processing_format(kSampleRate16kHz), | 1895 capture_processing_format(kSampleRate16kHz), |
| 1892 split_rate(kSampleRate16kHz) {} | 1896 split_rate(kSampleRate16kHz) {} |
| 1893 | 1897 |
| 1894 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; | 1898 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; |
| 1895 | 1899 |
| 1896 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; | 1900 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; |
| 1897 | 1901 |
| 1898 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; | 1902 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; |
| 1899 | 1903 |
| 1900 } // namespace webrtc | 1904 } // namespace webrtc |
| OLD | NEW |