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

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

Issue 1422013002: Preparational work for an upcoming addition of a threadchecking scheme for APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@bundling_of_state_CL
Patch Set: Fixed the final threadchecker refactoring issues (and merged from latest master) Created 5 years, 1 month 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.cc
diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.cc b/webrtc/modules/audio_processing/echo_cancellation_impl.cc
index 14d1fc8e196c7e03f688104ad5f65586d9a4826e..e75930ef76c9c2fa919fb5661ca17615929d25d2 100644
--- a/webrtc/modules/audio_processing/echo_cancellation_impl.cc
+++ b/webrtc/modules/audio_processing/echo_cancellation_impl.cc
@@ -62,11 +62,14 @@ static const size_t kMaxAllowedValuesOfSamplesPerFrame = 160;
static const size_t kMaxNumFramesToBuffer = 100;
} // namespace
-EchoCancellationImpl::EchoCancellationImpl(const AudioProcessing* apm,
- CriticalSectionWrapper* crit)
+EchoCancellationImpl::EchoCancellationImpl(
+ const AudioProcessing* apm,
+ CriticalSectionWrapper* crit,
+ const rtc::ThreadChecker* render_thread_checker)
: ProcessingComponent(),
apm_(apm),
crit_(crit),
+ render_thread_checker_(render_thread_checker),
drift_compensation_enabled_(false),
metrics_enabled_(false),
suppression_level_(kModerateSuppression),
@@ -81,6 +84,7 @@ EchoCancellationImpl::EchoCancellationImpl(const AudioProcessing* apm,
EchoCancellationImpl::~EchoCancellationImpl() {}
int EchoCancellationImpl::ProcessRenderAudio(const AudioBuffer* audio) {
+ RTC_DCHECK(render_thread_checker_->CalledOnValidThread());
if (!is_component_enabled()) {
return apm_->kNoError;
}
@@ -441,7 +445,6 @@ int EchoCancellationImpl::ConfigureHandle(void* handle) const {
config.nlpMode = MapSetting(suppression_level_);
config.skewMode = drift_compensation_enabled_;
config.delay_logging = delay_logging_enabled_;
-
WebRtcAec_enable_extended_filter(
WebRtcAec_aec_core(static_cast<Handle*>(handle)),
extended_filter_enabled_ ? 1 : 0);

Powered by Google App Engine
This is Rietveld 408576698