Index: webrtc/modules/audio_processing/level_estimator_impl.h |
diff --git a/webrtc/modules/audio_processing/level_estimator_impl.h b/webrtc/modules/audio_processing/level_estimator_impl.h |
index d560223157f0d115d811f7d466f5b2140ea8ad43..4401da37e432d1ed85dcea52c06156e8d3fef164 100644 |
--- a/webrtc/modules/audio_processing/level_estimator_impl.h |
+++ b/webrtc/modules/audio_processing/level_estimator_impl.h |
@@ -11,42 +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 RMSLevel; |
-class LevelEstimatorImpl : public LevelEstimator, |
- public ProcessingComponent { |
+class LevelEstimatorImpl : public LevelEstimator { |
public: |
- LevelEstimatorImpl(const AudioProcessing* apm, rtc::CriticalSection* 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; |
- |
- rtc::CriticalSection* const 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_ |