Harmonize APM config logging, update config ToString

It is unclear what configuration the APM is running with.
This CL helps some of that. Note that the webrtc::Config
is still not reported.

Bug: webrtc:5298
Change-Id: Icc2cf0b20634c04d567c0951a57ba6fe7aa5c5b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157423
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29555}
This commit is contained in:
Sam Zackrisson
2019-10-21 12:54:02 +02:00
committed by Commit Bot
parent 682dabd1c1
commit 72cc71cd70
2 changed files with 16 additions and 14 deletions

View File

@ -341,6 +341,15 @@ AudioProcessingImpl::AudioProcessingImpl(
capture_(config.Get<ExperimentalNs>().enabled), capture_(config.Get<ExperimentalNs>().enabled),
#endif #endif
capture_nonlocked_() { capture_nonlocked_() {
RTC_LOG(LS_INFO) << "Injected APM submodules:"
<< "\nEcho control factory: " << !!echo_control_factory_
<< "\nEcho detector: " << !!submodules_.echo_detector
<< "\nCapture analyzer: " << !!submodules_.capture_analyzer
<< "\nCapture post processor: "
<< !!submodules_.capture_post_processor
<< "\nRender pre processor: "
<< !!submodules_.render_pre_processor;
// Mark Echo Controller enabled if a factory is injected. // Mark Echo Controller enabled if a factory is injected.
capture_nonlocked_.echo_controller_enabled = capture_nonlocked_.echo_controller_enabled =
static_cast<bool>(echo_control_factory_); static_cast<bool>(echo_control_factory_);
@ -359,13 +368,6 @@ AudioProcessingImpl::AudioProcessingImpl(
// implemented. // implemented.
submodules_.gain_controller2.reset(new GainController2()); submodules_.gain_controller2.reset(new GainController2());
RTC_LOG(LS_INFO) << "Capture analyzer activated: "
<< !!submodules_.capture_analyzer
<< "\nCapture post processor activated: "
<< !!submodules_.capture_post_processor
<< "\nRender pre processor activated: "
<< !!submodules_.render_pre_processor;
SetExtraOptions(config); SetExtraOptions(config);
} }
@ -604,6 +606,8 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
} }
void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) { void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
RTC_LOG(LS_INFO) << "AudioProcessing::ApplyConfig: " << config.ToString();
// Run in a single-threaded manner when applying the settings. // Run in a single-threaded manner when applying the settings.
rtc::CritScope cs_render(&crit_render_); rtc::CritScope cs_render(&crit_render_);
rtc::CritScope cs_capture(&crit_capture_); rtc::CritScope cs_capture(&crit_capture_);
@ -654,9 +658,6 @@ void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
InitializeHighPassFilter(); InitializeHighPassFilter();
RTC_LOG(LS_INFO) << "Highpass filter activated: "
<< config_.high_pass_filter.enabled;
if (agc1_config_changed) { if (agc1_config_changed) {
ApplyAgc1Config(config_.gain_controller1); ApplyAgc1Config(config_.gain_controller1);
} }
@ -672,10 +673,6 @@ void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
InitializeGainController2(); InitializeGainController2();
InitializePreAmplifier(); InitializePreAmplifier();
submodules_.gain_controller2->ApplyConfig(config_.gain_controller2); submodules_.gain_controller2->ApplyConfig(config_.gain_controller2);
RTC_LOG(LS_INFO) << "Gain Controller 2 activated: "
<< config_.gain_controller2.enabled;
RTC_LOG(LS_INFO) << "Pre-amplifier activated: "
<< config_.pre_amplifier.enabled;
if (config_.level_estimation.enabled && !submodules_.output_level_estimator) { if (config_.level_estimation.enabled && !submodules_.output_level_estimator) {
submodules_.output_level_estimator = std::make_unique<LevelEstimator>(); submodules_.output_level_estimator = std::make_unique<LevelEstimator>();

View File

@ -72,6 +72,11 @@ std::string AudioProcessing::Config::ToString() const {
char buf[1024]; char buf[1024];
rtc::SimpleStringBuilder builder(buf); rtc::SimpleStringBuilder builder(buf);
builder << "AudioProcessing::Config{ " builder << "AudioProcessing::Config{ "
<< "pipeline: {"
<< "maximum_internal_processing_rate: "
<< pipeline.maximum_internal_processing_rate
<< ", experimental_multi_channel: "
<< pipeline.experimental_multi_channel << "}, "
<< "pre_amplifier: { enabled: " << pre_amplifier.enabled << "pre_amplifier: { enabled: " << pre_amplifier.enabled
<< ", fixed_gain_factor: " << pre_amplifier.fixed_gain_factor << ", fixed_gain_factor: " << pre_amplifier.fixed_gain_factor
<< " }, high_pass_filter: { enabled: " << high_pass_filter.enabled << " }, high_pass_filter: { enabled: " << high_pass_filter.enabled