| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 if (settings_.use_refined_adaptive_filter) { | 280 if (settings_.use_refined_adaptive_filter) { |
| 281 config.Set<RefinedAdaptiveFilter>( | 281 config.Set<RefinedAdaptiveFilter>( |
| 282 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); | 282 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); |
| 283 } | 283 } |
| 284 config.Set<ExtendedFilter>(new ExtendedFilter( | 284 config.Set<ExtendedFilter>(new ExtendedFilter( |
| 285 !settings_.use_extended_filter || *settings_.use_extended_filter)); | 285 !settings_.use_extended_filter || *settings_.use_extended_filter)); |
| 286 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || | 286 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || |
| 287 *settings_.use_delay_agnostic)); | 287 *settings_.use_delay_agnostic)); |
| 288 config.Set<ExperimentalAgc>(new ExperimentalAgc( |
| 289 !settings_.use_experimental_agc || *settings_.use_experimental_agc)); |
| 288 if (settings_.use_ed) { | 290 if (settings_.use_ed) { |
| 289 apm_config.residual_echo_detector.enabled = *settings_.use_ed; | 291 apm_config.residual_echo_detector.enabled = *settings_.use_ed; |
| 290 } | 292 } |
| 291 | 293 |
| 292 ap_.reset(AudioProcessing::Create(config)); | 294 ap_.reset(AudioProcessing::Create(config)); |
| 293 RTC_CHECK(ap_); | 295 RTC_CHECK(ap_); |
| 294 | 296 |
| 295 ap_->ApplyConfig(apm_config); | 297 ap_->ApplyConfig(apm_config); |
| 296 | 298 |
| 297 if (settings_.use_aec) { | 299 if (settings_.use_aec) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 320 } | 322 } |
| 321 if (settings_.use_agc_limiter) { | 323 if (settings_.use_agc_limiter) { |
| 322 RTC_CHECK_EQ(AudioProcessing::kNoError, ap_->gain_control()->enable_limiter( | 324 RTC_CHECK_EQ(AudioProcessing::kNoError, ap_->gain_control()->enable_limiter( |
| 323 *settings_.use_agc_limiter)); | 325 *settings_.use_agc_limiter)); |
| 324 } | 326 } |
| 325 if (settings_.agc_target_level) { | 327 if (settings_.agc_target_level) { |
| 326 RTC_CHECK_EQ(AudioProcessing::kNoError, | 328 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 327 ap_->gain_control()->set_target_level_dbfs( | 329 ap_->gain_control()->set_target_level_dbfs( |
| 328 *settings_.agc_target_level)); | 330 *settings_.agc_target_level)); |
| 329 } | 331 } |
| 330 | 332 if (settings_.agc_compression_gain) { |
| 333 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 334 ap_->gain_control()->set_compression_gain_db( |
| 335 *settings_.agc_compression_gain)); |
| 336 } |
| 331 if (settings_.agc_mode) { | 337 if (settings_.agc_mode) { |
| 332 RTC_CHECK_EQ( | 338 RTC_CHECK_EQ( |
| 333 AudioProcessing::kNoError, | 339 AudioProcessing::kNoError, |
| 334 ap_->gain_control()->set_mode( | 340 ap_->gain_control()->set_mode( |
| 335 static_cast<webrtc::GainControl::Mode>(*settings_.agc_mode))); | 341 static_cast<webrtc::GainControl::Mode>(*settings_.agc_mode))); |
| 336 } | 342 } |
| 337 | 343 |
| 338 if (settings_.use_drift_compensation) { | 344 if (settings_.use_drift_compensation) { |
| 339 RTC_CHECK_EQ(AudioProcessing::kNoError, | 345 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 340 ap_->echo_cancellation()->enable_drift_compensation( | 346 ap_->echo_cancellation()->enable_drift_compensation( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; | 388 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; |
| 383 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); | 389 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); |
| 384 RTC_CHECK_EQ(AudioProcessing::kNoError, | 390 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 385 ap_->StartDebugRecording( | 391 ap_->StartDebugRecording( |
| 386 settings_.aec_dump_output_filename->c_str(), -1)); | 392 settings_.aec_dump_output_filename->c_str(), -1)); |
| 387 } | 393 } |
| 388 } | 394 } |
| 389 | 395 |
| 390 } // namespace test | 396 } // namespace test |
| 391 } // namespace webrtc | 397 } // namespace webrtc |
| OLD | NEW |