Make LevelEstimation not a ProcessingComponent.
BUG=webrtc:5355 Review URL: https://codereview.webrtc.org/1523483002 Cr-Commit-Position: refs/heads/master@{#11033}
This commit is contained in:
@ -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_
|
||||
|
||||
Reference in New Issue
Block a user