aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_processing/level_estimator_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/modules/audio_processing/level_estimator_impl.h')
-rw-r--r--webrtc/modules/audio_processing/level_estimator_impl.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/webrtc/modules/audio_processing/level_estimator_impl.h b/webrtc/modules/audio_processing/level_estimator_impl.h
index 0d0050c7e7..4401da37e4 100644
--- a/webrtc/modules/audio_processing/level_estimator_impl.h
+++ b/webrtc/modules/audio_processing/level_estimator_impl.h
@@ -11,43 +11,36 @@
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_ESTIMATOR_IMPL_H_
#define WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_ESTIMATOR_IMPL_H_
+#include "webrtc/base/constructormagic.h"
+#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
-#include "webrtc/modules/audio_processing/processing_component.h"
-#include "webrtc/modules/audio_processing/rms_level.h"
namespace webrtc {
class AudioBuffer;
-class CriticalSectionWrapper;
+class RMSLevel;
-class LevelEstimatorImpl : public LevelEstimator,
- public ProcessingComponent {
+class LevelEstimatorImpl : public LevelEstimator {
public:
- LevelEstimatorImpl(const AudioProcessing* apm,
- CriticalSectionWrapper* crit);
- virtual ~LevelEstimatorImpl();
+ explicit LevelEstimatorImpl(rtc::CriticalSection* crit);
+ ~LevelEstimatorImpl() override;
- int ProcessStream(AudioBuffer* audio);
+ // TODO(peah): Fold into ctor, once public API is removed.
+ void Initialize();
+ void ProcessStream(AudioBuffer* audio);
// LevelEstimator implementation.
- bool is_enabled() const override;
-
- private:
- // LevelEstimator implementation.
int Enable(bool enable) override;
+ bool is_enabled() const override;
int RMS() override;
- // ProcessingComponent implementation.
- void* CreateHandle() const override;
- int InitializeHandle(void* handle) const override;
- int ConfigureHandle(void* handle) const override;
- void DestroyHandle(void* handle) const override;
- int num_handles_required() const override;
- int GetHandleError(void* handle) const override;
-
- CriticalSectionWrapper* crit_;
+ private:
+ rtc::CriticalSection* const crit_ = nullptr;
+ bool enabled_ GUARDED_BY(crit_) = false;
+ rtc::scoped_ptr<RMSLevel> rms_ GUARDED_BY(crit_);
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(LevelEstimatorImpl);
};
-
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_ESTIMATOR_IMPL_H_