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

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

Issue 2534473004: Add a new UMA metric in APM to track incoming capture-side audio level (Closed)
Patch Set: Rebase to upstream CL Created 4 years, 1 month 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/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index 39c79cdf5c562e06f1916dd16696360791389d4e..c0113a3070e1bd6e6806ec745b66f4d0213ea080 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -1095,6 +1095,18 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity.
+ rms_.Analyze(rtc::ArrayView<const int16_t>(
+ capture_buffer->channels_const()[0],
+ capture_nonlocked_.capture_processing_format.num_frames()));
+ if (++rms_interval_counter_ >= 1000) {
+ rms_interval_counter_ = 0;
+ RmsLevel::Levels levels = rms_.AverageAndPeak();
+ RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelAverage",
+ levels.average, 1, RmsLevel::kMinLevelDb, 100);
+ RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelPeak", levels.peak,
+ 1, RmsLevel::kMinLevelDb, 100);
+ }
+
if (constants_.use_experimental_agc &&
public_submodules_->gain_control->is_enabled()) {
private_submodules_->agc_manager->AnalyzePreProcess(

Powered by Google App Engine
This is Rietveld 408576698