Chromium Code Reviews| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 std::cout << " Forward: " << get_num_process_stream_calls() << std::endl; | 229 std::cout << " Forward: " << get_num_process_stream_calls() << std::endl; |
| 230 std::cout << " Reverse: " << get_num_reverse_process_stream_calls() | 230 std::cout << " Reverse: " << get_num_reverse_process_stream_calls() |
| 231 << std::endl; | 231 << std::endl; |
| 232 } | 232 } |
| 233 | 233 |
| 234 if (!settings_.discard_all_settings_in_aecdump) { | 234 if (!settings_.discard_all_settings_in_aecdump) { |
| 235 if (settings_.use_verbose_logging) { | 235 if (settings_.use_verbose_logging) { |
| 236 std::cout << "Setting used in config:" << std::endl; | 236 std::cout << "Setting used in config:" << std::endl; |
| 237 } | 237 } |
| 238 Config config; | 238 Config config; |
| 239 AudioProcessing::Config apm_config; | |
| 239 | 240 |
| 240 if (msg.has_aec_enabled() || settings_.use_aec) { | 241 if (msg.has_aec_enabled() || settings_.use_aec) { |
| 241 bool enable = settings_.use_aec ? *settings_.use_aec : msg.aec_enabled(); | 242 bool enable = settings_.use_aec ? *settings_.use_aec : msg.aec_enabled(); |
| 242 RTC_CHECK_EQ(AudioProcessing::kNoError, | 243 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 243 ap_->echo_cancellation()->Enable(enable)); | 244 ap_->echo_cancellation()->Enable(enable)); |
| 244 if (settings_.use_verbose_logging) { | 245 if (settings_.use_verbose_logging) { |
| 245 std::cout << " aec_enabled: " << (enable ? "true" : "false") | 246 std::cout << " aec_enabled: " << (enable ? "true" : "false") |
| 246 << std::endl; | 247 << std::endl; |
| 247 } | 248 } |
| 248 } | 249 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 435 if (settings_.use_refined_adaptive_filter) { | 436 if (settings_.use_refined_adaptive_filter) { |
| 436 config.Set<RefinedAdaptiveFilter>( | 437 config.Set<RefinedAdaptiveFilter>( |
| 437 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); | 438 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); |
| 438 } | 439 } |
| 439 | 440 |
| 440 if (settings_.use_aec3) { | 441 if (settings_.use_aec3) { |
| 441 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); | 442 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); |
| 442 } | 443 } |
| 443 | 444 |
| 444 if (settings_.use_lc) { | 445 if (settings_.use_lc) { |
| 445 config.Set<LevelControl>(new LevelControl(true)); | 446 apm_config.level_controller.enabled = true; |
| 446 } | 447 } |
| 447 | 448 |
| 449 RTC_DCHECK(apm_config.Validate()); | |
|
the sun
2016/09/01 13:48:01
dd
peah-webrtc
2016/09/02 08:22:01
Done.
| |
| 450 RTC_CHECK(ap_->ApplyConfig(apm_config)); | |
| 448 ap_->SetExtraOptions(config); | 451 ap_->SetExtraOptions(config); |
| 449 } | 452 } |
| 450 } | 453 } |
| 451 | 454 |
| 452 void AecDumpBasedSimulator::HandleMessage(const webrtc::audioproc::Init& msg) { | 455 void AecDumpBasedSimulator::HandleMessage(const webrtc::audioproc::Init& msg) { |
| 453 RTC_CHECK(msg.has_sample_rate()); | 456 RTC_CHECK(msg.has_sample_rate()); |
| 454 RTC_CHECK(msg.has_num_input_channels()); | 457 RTC_CHECK(msg.has_num_input_channels()); |
| 455 RTC_CHECK(msg.has_num_reverse_channels()); | 458 RTC_CHECK(msg.has_num_reverse_channels()); |
| 456 RTC_CHECK(msg.has_reverse_sample_rate()); | 459 RTC_CHECK(msg.has_reverse_sample_rate()); |
| 457 | 460 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 } | 514 } |
| 512 | 515 |
| 513 void AecDumpBasedSimulator::HandleMessage( | 516 void AecDumpBasedSimulator::HandleMessage( |
| 514 const webrtc::audioproc::ReverseStream& msg) { | 517 const webrtc::audioproc::ReverseStream& msg) { |
| 515 PrepareReverseProcessStreamCall(msg); | 518 PrepareReverseProcessStreamCall(msg); |
| 516 ProcessReverseStream(interface_used_ == InterfaceType::kFixedInterface); | 519 ProcessReverseStream(interface_used_ == InterfaceType::kFixedInterface); |
| 517 } | 520 } |
| 518 | 521 |
| 519 } // namespace test | 522 } // namespace test |
| 520 } // namespace webrtc | 523 } // namespace webrtc |
| OLD | NEW |