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

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

Issue 1424663003: Lock scheme #8: Introduced the new locking scheme (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@add_threadcheckers_CL
Patch Set: Fixed a bad merge error for the beamformer settings and updated with the latest merge from master Created 5 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/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 35fe697c2d6defc1af1f16b556239d7c174e5c46..a434e9283c95d3a986b59b1a200c62416d089374 100644
--- a/webrtc/modules/audio_processing/level_estimator_impl.cc
+++ b/webrtc/modules/audio_processing/level_estimator_impl.cc
@@ -17,14 +17,13 @@
namespace webrtc {
-LevelEstimatorImpl::LevelEstimatorImpl(const AudioProcessing* apm,
- CriticalSectionWrapper* crit)
- : ProcessingComponent(),
- crit_(crit) {}
+LevelEstimatorImpl::LevelEstimatorImpl(const AudioProcessing* apm)
+ : ProcessingComponent() {}
LevelEstimatorImpl::~LevelEstimatorImpl() {}
int LevelEstimatorImpl::ProcessStream(AudioBuffer* audio) {
+ // Only called from within APM so no locking needed.
if (!is_component_enabled()) {
return AudioProcessing::kNoError;
}
@@ -39,15 +38,16 @@ int LevelEstimatorImpl::ProcessStream(AudioBuffer* audio) {
}
int LevelEstimatorImpl::Enable(bool enable) {
- CriticalSectionScoped crit_scoped(crit_);
return EnableComponent(enable);
}
bool LevelEstimatorImpl::is_enabled() const {
+ // Only called from within APM so no locking needed.
return is_component_enabled();
}
int LevelEstimatorImpl::RMS() {
+ // Only called from within APM so no locking needed.
if (!is_component_enabled()) {
return AudioProcessing::kNotEnabledError;
}

Powered by Google App Engine
This is Rietveld 408576698