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

Unified Diff: webrtc/modules/audio_processing/gain_control_impl.h

Issue 1768943002: Removed the dependency in GainControlImpl on the ProcessingComponent class (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@RemoveComponentFromAECM_CL
Patch Set: Changes according to reviewer comments Created 4 years, 9 months 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/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..ce90319afc863aeca1765029ab1adc431c2afb24 100644
--- a/webrtc/modules/audio_processing/gain_control_impl.h
+++ b/webrtc/modules/audio_processing/gain_control_impl.h
@@ -24,8 +24,7 @@ namespace webrtc {
class AudioBuffer;
-class GainControlImpl : public GainControl,
- public ProcessingComponent {
+class GainControlImpl : public GainControl {
public:
GainControlImpl(const AudioProcessing* apm,
rtc::CriticalSection* crit_render,
@@ -36,8 +35,7 @@ class GainControlImpl : public GainControl,
int AnalyzeCaptureAudio(AudioBuffer* audio);
int ProcessCaptureAudio(AudioBuffer* audio);
- // ProcessingComponent implementation.
- int Initialize() override;
+ void Initialize();
// GainControl implementation.
bool is_enabled() const override;
@@ -49,6 +47,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 +63,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,6 +74,8 @@ 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_);
@@ -99,6 +96,8 @@ 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_;
the sun 2016/03/09 09:42:11 Add a little constructormagic!
peah-webrtc 2016/03/09 12:23:39 Done.
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698