Index: webrtc/modules/audio_processing/agc/agc_manager_direct.cc |
diff --git a/webrtc/modules/audio_processing/agc/agc_manager_direct.cc b/webrtc/modules/audio_processing/agc/agc_manager_direct.cc |
index a4ac45af857c333da7ed3d67b78a2a2975eb64a7..cbab952e7019f3a8713a0dcf92c3e82c9f96de25 100644 |
--- a/webrtc/modules/audio_processing/agc/agc_manager_direct.cc |
+++ b/webrtc/modules/audio_processing/agc/agc_manager_direct.cc |
@@ -20,7 +20,6 @@ |
#include "webrtc/modules/audio_processing/agc/gain_map_internal.h" |
#include "webrtc/modules/audio_processing/gain_control_impl.h" |
#include "webrtc/modules/include/module_common_types.h" |
-#include "webrtc/system_wrappers/include/logging.h" |
#include "webrtc/system_wrappers/include/metrics.h" |
namespace webrtc { |
@@ -170,19 +169,15 @@ int AgcManagerDirect::Initialize() { |
// example, what happens when we change devices. |
if (gctrl_->set_mode(GainControl::kFixedDigital) != 0) { |
- LOG(LS_ERROR) << "set_mode(GainControl::kFixedDigital) failed."; |
return -1; |
} |
if (gctrl_->set_target_level_dbfs(2) != 0) { |
- LOG(LS_ERROR) << "set_target_level_dbfs(2) failed."; |
return -1; |
} |
if (gctrl_->set_compression_gain_db(kDefaultCompressionGain) != 0) { |
- LOG(LS_ERROR) << "set_compression_gain_db(kDefaultCompressionGain) failed."; |
return -1; |
} |
if (gctrl_->enable_limiter(true) != 0) { |
- LOG(LS_ERROR) << "enable_limiter(true) failed."; |
return -1; |
} |
return 0; |
@@ -214,8 +209,6 @@ void AgcManagerDirect::AnalyzePreProcess(int16_t* audio, |
// gain is increased, through SetMaxLevel(). |
float clipped_ratio = agc_->AnalyzePreproc(audio, length); |
if (clipped_ratio > kClippedRatioThreshold) { |
- LOG(LS_INFO) << "[agc] Clipping detected. clipped_ratio=" |
- << clipped_ratio; |
// Always decrease the maximum level, even if the current level is below |
// threshold. |
SetMaxLevel(std::max(clipped_level_min_, max_level_ - kClippedLevelStep)); |
@@ -248,7 +241,6 @@ void AgcManagerDirect::Process(const int16_t* audio, |
} |
if (agc_->Process(audio, length, sample_rate_hz) != 0) { |
- LOG(LS_ERROR) << "Agc::Process failed"; |
RTC_NOTREACHED(); |
} |
@@ -264,18 +256,14 @@ void AgcManagerDirect::SetLevel(int new_level) { |
return; |
} |
if (voe_level == 0) { |
- LOG(LS_INFO) << "[agc] VolumeCallbacks returned level=0, taking no action."; |
return; |
} |
if (voe_level > kMaxMicLevel) { |
- LOG(LS_ERROR) << "VolumeCallbacks returned an invalid level=" << voe_level; |
return; |
} |
if (voe_level > level_ + kLevelQuantizationSlack || |
voe_level < level_ - kLevelQuantizationSlack) { |
- LOG(LS_INFO) << "[agc] Mic volume was manually adjusted. Updating " |
- << "stored level from " << level_ << " to " << voe_level; |
level_ = voe_level; |
// Always allow the user to increase the volume. |
if (level_ > max_level_) { |
@@ -294,9 +282,6 @@ void AgcManagerDirect::SetLevel(int new_level) { |
} |
volume_callbacks_->SetMicVolume(new_level); |
- LOG(LS_INFO) << "[agc] voe_level=" << voe_level << ", " |
- << "level_=" << level_ << ", " |
- << "new_level=" << new_level; |
level_ = new_level; |
} |
@@ -310,8 +295,6 @@ void AgcManagerDirect::SetMaxLevel(int level) { |
(kMaxMicLevel - clipped_level_min_) * |
kSurplusCompressionGain + |
0.5f); |
- LOG(LS_INFO) << "[agc] max_level_=" << max_level_ |
- << ", max_compression_gain_=" << max_compression_gain_; |
} |
void AgcManagerDirect::SetCaptureMuted(bool muted) { |
@@ -340,19 +323,15 @@ int AgcManagerDirect::CheckVolumeAndReset() { |
// 2) Independent of interpretation of |level| == 0 we should raise it so the |
// AGC can do its job properly. |
if (level == 0 && !startup_) { |
- LOG(LS_INFO) << "[agc] VolumeCallbacks returned level=0, taking no action."; |
return 0; |
} |
if (level > kMaxMicLevel) { |
- LOG(LS_ERROR) << "VolumeCallbacks returned an invalid level=" << level; |
return -1; |
} |
- LOG(LS_INFO) << "[agc] Initial GetMicVolume()=" << level; |
int minLevel = startup_ ? startup_min_level_ : kMinMicLevel; |
if (level < minLevel) { |
level = minLevel; |
- LOG(LS_INFO) << "[agc] Initial volume too low, raising to " << level; |
volume_callbacks_->SetMicVolume(level); |
} |
agc_->Reset(); |
@@ -403,9 +382,6 @@ void AgcManagerDirect::UpdateGain() { |
int residual_gain = rms_error - raw_compression; |
residual_gain = std::min(std::max(residual_gain, -kMaxResidualGainChange), |
kMaxResidualGainChange); |
- LOG(LS_INFO) << "[agc] rms_error=" << rms_error << ", " |
- << "target_compression=" << target_compression_ << ", " |
- << "residual_gain=" << residual_gain; |
if (residual_gain == 0) |
return; |
@@ -446,8 +422,6 @@ void AgcManagerDirect::UpdateCompressor() { |
compression_ = new_compression; |
compression_accumulator_ = new_compression; |
if (gctrl_->set_compression_gain_db(compression_) != 0) { |
- LOG(LS_ERROR) << "set_compression_gain_db(" << compression_ |
- << ") failed."; |
} |
} |
} |