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

Side by Side 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 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 public_submodules_->echo_cancellation->stream_drift_samples()); 1088 public_submodules_->echo_cancellation->stream_drift_samples());
1089 msg->set_level(gain_control()->stream_analog_level()); 1089 msg->set_level(gain_control()->stream_analog_level());
1090 msg->set_keypress(capture_.key_pressed); 1090 msg->set_keypress(capture_.key_pressed);
1091 } 1091 }
1092 #endif 1092 #endif
1093 1093
1094 MaybeUpdateHistograms(); 1094 MaybeUpdateHistograms();
1095 1095
1096 AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity. 1096 AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity.
1097 1097
1098 rms_.Analyze(rtc::ArrayView<const int16_t>(
1099 capture_buffer->channels_const()[0],
1100 capture_nonlocked_.capture_processing_format.num_frames()));
1101 if (++rms_interval_counter_ >= 1000) {
1102 rms_interval_counter_ = 0;
1103 RmsLevel::Levels levels = rms_.AverageAndPeak();
1104 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelAverage",
1105 levels.average, 1, RmsLevel::kMinLevelDb, 100);
1106 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelPeak", levels.peak,
1107 1, RmsLevel::kMinLevelDb, 100);
1108 }
1109
1098 if (constants_.use_experimental_agc && 1110 if (constants_.use_experimental_agc &&
1099 public_submodules_->gain_control->is_enabled()) { 1111 public_submodules_->gain_control->is_enabled()) {
1100 private_submodules_->agc_manager->AnalyzePreProcess( 1112 private_submodules_->agc_manager->AnalyzePreProcess(
1101 capture_buffer->channels()[0], capture_buffer->num_channels(), 1113 capture_buffer->channels()[0], capture_buffer->num_channels(),
1102 capture_nonlocked_.capture_processing_format.num_frames()); 1114 capture_nonlocked_.capture_processing_format.num_frames());
1103 } 1115 }
1104 1116
1105 if (submodule_states_.CaptureMultiBandSubModulesActive() && 1117 if (submodule_states_.CaptureMultiBandSubModulesActive() &&
1106 SampleRateSupportsMultiBand( 1118 SampleRateSupportsMultiBand(
1107 capture_nonlocked_.capture_processing_format.sample_rate_hz())) { 1119 capture_nonlocked_.capture_processing_format.sample_rate_hz())) {
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 capture_processing_format(kSampleRate16kHz), 1891 capture_processing_format(kSampleRate16kHz),
1880 split_rate(kSampleRate16kHz) {} 1892 split_rate(kSampleRate16kHz) {}
1881 1893
1882 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1894 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1883 1895
1884 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1896 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1885 1897
1886 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1898 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1887 1899
1888 } // namespace webrtc 1900 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698