Add a new UMA metric in APM to track incoming capture-side audio level
This CL adds WebRTC.Audio.ApmCaptureInputLevelAverage and
WebRTC.Audio.ApmCaptureInputLevelPeak. The metrics are updated once
every 10 seconds.
BUG=webrtc:6622
Review-Url: https://codereview.webrtc.org/2534473004
Cr-Commit-Position: refs/heads/master@{#15300}
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
index d171715..4db2272 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.h
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h
@@ -25,6 +25,7 @@
#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/modules/audio_processing/render_queue_item_verifier.h"
+#include "webrtc/modules/audio_processing/rms_level.h"
#include "webrtc/system_wrappers/include/file_wrapper.h"
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
@@ -406,6 +407,9 @@
std::vector<float> red_render_queue_buffer_ GUARDED_BY(crit_render_);
std::vector<float> red_capture_queue_buffer_ GUARDED_BY(crit_capture_);
+ RmsLevel rms_ GUARDED_BY(crit_capture_);
+ int rms_interval_counter_ GUARDED_BY(crit_capture_) = 0;
+
// Lock protection not needed.
std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
aec_render_signal_queue_;