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

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

Issue 1761813002: Removed the inheritance from ProcessingComponent for EchoCancellerImpl. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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/echo_cancellation_impl.h
diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.h b/webrtc/modules/audio_processing/echo_cancellation_impl.h
index fbc2bcc465383a99941a517788c11fea02058d0a..194819984efad6c33941b839b65e0d9ab4016be2 100644
--- a/webrtc/modules/audio_processing/echo_cancellation_impl.h
+++ b/webrtc/modules/audio_processing/echo_cancellation_impl.h
@@ -13,6 +13,7 @@
#include <memory>
+#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/common_audio/swap_queue.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
@@ -22,8 +23,7 @@ namespace webrtc {
class AudioBuffer;
-class EchoCancellationImpl : public EchoCancellation,
- public ProcessingComponent {
+class EchoCancellationImpl : public EchoCancellation {
public:
EchoCancellationImpl(const AudioProcessing* apm,
rtc::CriticalSection* crit_render,
@@ -39,9 +39,8 @@ class EchoCancellationImpl : public EchoCancellation,
SuppressionLevel suppression_level() const override;
bool is_drift_compensation_enabled() const override;
- // ProcessingComponent implementation.
- int Initialize() override;
- void SetExtraOptions(const Config& config) override;
+ void Initialize();
+ void SetExtraOptions(const Config& config);
bool is_delay_agnostic_enabled() const;
bool is_extended_filter_enabled() const;
bool is_next_generation_aec_enabled() const;
@@ -51,6 +50,8 @@ class EchoCancellationImpl : public EchoCancellation,
void ReadQueuedRenderData();
private:
+ class Canceller;
+
// EchoCancellation implementation.
int Enable(bool enable) override;
int enable_drift_compensation(bool enable) override;
@@ -69,15 +70,10 @@ class EchoCancellationImpl : public EchoCancellation,
struct AecCore* aec_core() 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_;
the sun 2016/03/03 10:00:53 Ah, this is why there aren't more changes to the i
peah-webrtc 2016/03/03 12:06:34 Yes, that should definitely be broken. But in can
the sun 2016/03/03 13:13:05 Good idea to do things piecewise! When I did the H
@@ -85,6 +81,7 @@ class EchoCancellationImpl : public EchoCancellation,
rtc::CriticalSection* const crit_render_ ACQUIRED_BEFORE(crit_capture_);
rtc::CriticalSection* const crit_capture_;
+ bool enabled_ = false;
the sun 2016/03/03 10:00:53 No crit sect guard?
peah-webrtc 2016/03/03 12:06:34 This is not possible, as this variable is used in
the sun 2016/03/03 13:13:05 Acknowledged.
bool drift_compensation_enabled_ GUARDED_BY(crit_capture_);
bool metrics_enabled_ GUARDED_BY(crit_capture_);
SuppressionLevel suppression_level_ GUARDED_BY(crit_capture_);
@@ -104,6 +101,9 @@ class EchoCancellationImpl : public EchoCancellation,
// Lock protection not needed.
std::unique_ptr<SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>>
render_signal_queue_;
+
+ std::vector<std::unique_ptr<Canceller>> cancellers_;
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCancellationImpl);
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698