| Index: webrtc/modules/audio_processing/gain_control_impl.h
|
| diff --git a/webrtc/modules/audio_processing/gain_control_impl.h b/webrtc/modules/audio_processing/gain_control_impl.h
|
| index 942a1835e445ed48969d2f97ecedf2c1109cef01..54b8ea79209e88e72b31aa43f38f8bd20b04131c 100644
|
| --- a/webrtc/modules/audio_processing/gain_control_impl.h
|
| +++ b/webrtc/modules/audio_processing/gain_control_impl.h
|
| @@ -14,6 +14,7 @@
|
| #include <memory>
|
| #include <vector>
|
|
|
| +#include "webrtc/base/constructormagic.h"
|
| #include "webrtc/base/criticalsection.h"
|
| #include "webrtc/base/thread_annotations.h"
|
| #include "webrtc/common_audio/swap_queue.h"
|
| @@ -24,20 +25,18 @@ namespace webrtc {
|
|
|
| class AudioBuffer;
|
|
|
| -class GainControlImpl : public GainControl,
|
| - public ProcessingComponent {
|
| +class GainControlImpl : public GainControl {
|
| public:
|
| GainControlImpl(const AudioProcessing* apm,
|
| rtc::CriticalSection* crit_render,
|
| rtc::CriticalSection* crit_capture);
|
| - virtual ~GainControlImpl();
|
| + ~GainControlImpl() override;
|
|
|
| int ProcessRenderAudio(AudioBuffer* audio);
|
| int AnalyzeCaptureAudio(AudioBuffer* audio);
|
| int ProcessCaptureAudio(AudioBuffer* audio);
|
|
|
| - // ProcessingComponent implementation.
|
| - int Initialize() override;
|
| + void Initialize();
|
|
|
| // GainControl implementation.
|
| bool is_enabled() const override;
|
| @@ -49,6 +48,8 @@ class GainControlImpl : public GainControl,
|
| void ReadQueuedRenderData();
|
|
|
| private:
|
| + class GainController;
|
| +
|
| // GainControl implementation.
|
| int Enable(bool enable) override;
|
| int set_stream_analog_level(int level) override;
|
| @@ -63,15 +64,10 @@ class GainControlImpl : public GainControl,
|
| int analog_level_maximum() const override;
|
| bool stream_is_saturated() const 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;
|
| - size_t num_handles_required() const override;
|
| - int GetHandleError(void* handle) const override;
|
| + size_t num_handles_required() const;
|
|
|
| void AllocateRenderQueue();
|
| + int Configure();
|
|
|
| // Not guarded as its public API is thread safe.
|
| const AudioProcessing* apm_;
|
| @@ -79,13 +75,14 @@ class GainControlImpl : public GainControl,
|
| rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_);
|
| rtc::CriticalSection* const crit_capture_;
|
|
|
| + bool enabled_ = false;
|
| +
|
| Mode mode_ GUARDED_BY(crit_capture_);
|
| int minimum_capture_level_ GUARDED_BY(crit_capture_);
|
| int maximum_capture_level_ GUARDED_BY(crit_capture_);
|
| bool limiter_enabled_ GUARDED_BY(crit_capture_);
|
| int target_level_dbfs_ GUARDED_BY(crit_capture_);
|
| int compression_gain_db_ GUARDED_BY(crit_capture_);
|
| - std::vector<int> capture_levels_ GUARDED_BY(crit_capture_);
|
| int analog_capture_level_ GUARDED_BY(crit_capture_);
|
| bool was_analog_level_set_ GUARDED_BY(crit_capture_);
|
| bool stream_is_saturated_ GUARDED_BY(crit_capture_);
|
| @@ -99,6 +96,10 @@ class GainControlImpl : public GainControl,
|
| std::unique_ptr<
|
| SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>
|
| render_signal_queue_;
|
| +
|
| + std::vector<std::unique_ptr<GainController>> gain_controllers_;
|
| +
|
| + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GainControlImpl);
|
| };
|
| } // namespace webrtc
|
|
|
|
|