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

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

Issue 2535523002: Refactor RMSLevel and give it new functionality (Closed)
Patch Set: Rename to RmsLevel 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
« no previous file with comments | « webrtc/modules/audio_processing/level_estimator_impl.h ('k') | webrtc/modules/audio_processing/rms_level.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/level_estimator_impl.cc
diff --git a/webrtc/modules/audio_processing/level_estimator_impl.cc b/webrtc/modules/audio_processing/level_estimator_impl.cc
index 187873e33e00f2e20bb3745045eedb06c322e3eb..7b91654c9ab2040d7c909e0230d931da44410ec8 100644
--- a/webrtc/modules/audio_processing/level_estimator_impl.cc
+++ b/webrtc/modules/audio_processing/level_estimator_impl.cc
@@ -10,6 +10,7 @@
#include "webrtc/modules/audio_processing/level_estimator_impl.h"
+#include "webrtc/base/array_view.h"
#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/rms_level.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
@@ -17,7 +18,7 @@
namespace webrtc {
LevelEstimatorImpl::LevelEstimatorImpl(rtc::CriticalSection* crit)
- : crit_(crit), rms_(new RMSLevel()) {
+ : crit_(crit), rms_(new RmsLevel()) {
RTC_DCHECK(crit);
}
@@ -36,7 +37,8 @@ void LevelEstimatorImpl::ProcessStream(AudioBuffer* audio) {
}
for (size_t i = 0; i < audio->num_channels(); i++) {
- rms_->Process(audio->channels_const()[i], audio->num_frames());
+ rms_->Analyze(rtc::ArrayView<const int16_t>(audio->channels_const()[i],
+ audio->num_frames()));
}
}
@@ -60,6 +62,6 @@ int LevelEstimatorImpl::RMS() {
return AudioProcessing::kNotEnabledError;
}
- return rms_->RMS();
+ return rms_->Average();
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_processing/level_estimator_impl.h ('k') | webrtc/modules/audio_processing/rms_level.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698