To verify the upcoming code changes it is required
that the level of the output in the audio processing module is monitored. This CL adds that. BUG=webrtc:6181, webrtc:6183, webrtc:6220 Review-Url: https://codereview.webrtc.org/2549143004 Cr-Commit-Position: refs/heads/master@{#15718}
This commit is contained in:
parent
0838327ec9
commit
1b08dc33eb
@ -1132,12 +1132,13 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
|
||||
|
||||
AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity.
|
||||
|
||||
rms_.Analyze(rtc::ArrayView<const int16_t>(
|
||||
capture_input_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();
|
||||
const bool log_rms = ++capture_rms_interval_counter_ >= 1000;
|
||||
if (log_rms) {
|
||||
capture_rms_interval_counter_ = 0;
|
||||
RmsLevel::Levels levels = capture_input_rms_.AverageAndPeak();
|
||||
RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelAverageRms",
|
||||
levels.average, 1, RmsLevel::kMinLevelDb, 64);
|
||||
RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelPeakRms",
|
||||
@ -1275,6 +1276,17 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
|
||||
// The level estimator operates on the recombined data.
|
||||
public_submodules_->level_estimator->ProcessStream(capture_buffer);
|
||||
|
||||
capture_output_rms_.Analyze(rtc::ArrayView<const int16_t>(
|
||||
capture_buffer->channels_const()[0],
|
||||
capture_nonlocked_.capture_processing_format.num_frames()));
|
||||
if (log_rms) {
|
||||
RmsLevel::Levels levels = capture_output_rms_.AverageAndPeak();
|
||||
RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureOutputLevelAverageRms",
|
||||
levels.average, 1, RmsLevel::kMinLevelDb, 64);
|
||||
RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureOutputLevelPeakRms",
|
||||
levels.peak, 1, RmsLevel::kMinLevelDb, 64);
|
||||
}
|
||||
|
||||
capture_.was_stream_delay_set = false;
|
||||
return kNoError;
|
||||
}
|
||||
|
||||
@ -415,8 +415,9 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
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;
|
||||
RmsLevel capture_input_rms_ GUARDED_BY(crit_capture_);
|
||||
RmsLevel capture_output_rms_ GUARDED_BY(crit_capture_);
|
||||
int capture_rms_interval_counter_ GUARDED_BY(crit_capture_) = 0;
|
||||
|
||||
// Lock protection not needed.
|
||||
std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user