Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: webrtc/modules/audio_processing/gain_control_impl.cc

Issue 2457783003: Added offline data logpoints and logging functionality to the gain controller (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/gain_control_impl.cc
diff --git a/webrtc/modules/audio_processing/gain_control_impl.cc b/webrtc/modules/audio_processing/gain_control_impl.cc
index 8f707fc3b524295ae2439d98412d2aba6f3c4733..81469dde01b3f59c278e7639f7f2b77d4d878371 100644
--- a/webrtc/modules/audio_processing/gain_control_impl.cc
+++ b/webrtc/modules/audio_processing/gain_control_impl.cc
@@ -14,6 +14,7 @@
#include "webrtc/base/optional.h"
#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/agc/legacy/gain_control.h"
+#include "webrtc/modules/audio_processing/logging/apm_data_dumper.h"
namespace webrtc {
@@ -84,10 +85,13 @@ class GainControlImpl::GainController {
RTC_DISALLOW_COPY_AND_ASSIGN(GainController);
};
+int GainControlImpl::instance_counter_ = 0;
+
GainControlImpl::GainControlImpl(rtc::CriticalSection* crit_render,
rtc::CriticalSection* crit_capture)
: crit_render_(crit_render),
crit_capture_(crit_capture),
+ data_dumper_(new ApmDataDumper(instance_counter_)),
ivoc 2016/10/28 09:20:10 The experimental AGC and the regular AGC could end
peah-webrtc 2016/10/28 09:43:41 They are not in practice active at the same time.
mode_(kAdaptiveAnalog),
minimum_capture_level_(0),
maximum_capture_level_(255),
@@ -239,6 +243,7 @@ int GainControlImpl::compression_gain_db() const {
// TODO(ajm): ensure this is called under kAdaptiveAnalog.
int GainControlImpl::set_stream_analog_level(int level) {
rtc::CritScope cs(crit_capture_);
+ data_dumper_->DumpRaw("gain_control_set_stream_analog_level", 1, &level);
ivoc 2016/10/28 09:20:10 Shouldn't there be a way to enable/disable this lo
peah-webrtc 2016/10/28 09:43:41 There is. What happens is that this method call ex
was_analog_level_set_ = true;
if (level < minimum_capture_level_ || level > maximum_capture_level_) {
@@ -251,6 +256,8 @@ int GainControlImpl::set_stream_analog_level(int level) {
int GainControlImpl::stream_analog_level() {
rtc::CritScope cs(crit_capture_);
+ data_dumper_->DumpRaw("gain_control_stream_analog_level", 1,
+ &analog_capture_level_);
// TODO(ajm): enable this assertion?
//RTC_DCHECK_EQ(kAdaptiveAnalog, mode_);
@@ -385,6 +392,7 @@ bool GainControlImpl::is_limiter_enabled() const {
void GainControlImpl::Initialize(size_t num_proc_channels, int sample_rate_hz) {
rtc::CritScope cs_render(crit_render_);
rtc::CritScope cs_capture(crit_capture_);
+ data_dumper_->InitiateNewSetOfRecordings();
num_proc_channels_ = rtc::Optional<size_t>(num_proc_channels);
sample_rate_hz_ = rtc::Optional<int>(sample_rate_hz);

Powered by Google App Engine
This is Rietveld 408576698