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

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: Created 5 years, 2 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.cc
diff --git a/webrtc/modules/audio_processing/echo_cancellation_impl.cc b/webrtc/modules/audio_processing/echo_cancellation_impl.cc
index 1422cb8d72791e4d5d2c2ee3108cbb9851deb581..07f96fa170564a189256b3e4da77826f7a81ba3b 100644
--- a/webrtc/modules/audio_processing/echo_cancellation_impl.cc
+++ b/webrtc/modules/audio_processing/echo_cancellation_impl.cc
@@ -59,10 +59,14 @@ const size_t EchoCancellationImpl::kAllowedValuesOfSamplesPerFrame1;
const size_t EchoCancellationImpl::kAllowedValuesOfSamplesPerFrame2;
EchoCancellationImpl::EchoCancellationImpl(const AudioProcessing* apm,
- CriticalSectionWrapper* crit)
+ CriticalSectionWrapper* crit,
+ rtc::ThreadChecker* render_thread,
+ rtc::ThreadChecker* capture_thread)
: ProcessingComponent(),
apm_(apm),
crit_(crit),
+ render_thread_(render_thread),
+ capture_thread_(capture_thread),
drift_compensation_enabled_(false),
metrics_enabled_(false),
suppression_level_(kModerateSuppression),
@@ -79,6 +83,7 @@ EchoCancellationImpl::EchoCancellationImpl(const AudioProcessing* apm,
EchoCancellationImpl::~EchoCancellationImpl() {}
int EchoCancellationImpl::ProcessRenderAudio(const AudioBuffer* audio) {
+ RTC_DCHECK(render_thread_->CalledOnValidThread());
if (!is_component_enabled()) {
return apm_->kNoError;
}
@@ -128,6 +133,7 @@ int EchoCancellationImpl::ProcessRenderAudio(const AudioBuffer* audio) {
// Read chunks of data that were received and queued on the render side from
// a queue. All the data chunks are buffered into the farend signal of the AEC.
void EchoCancellationImpl::ReadQueuedRenderData() {
+ RTC_DCHECK(capture_thread_->CalledOnValidThread());
if (!is_component_enabled()) {
return;
}
@@ -155,6 +161,7 @@ void EchoCancellationImpl::ReadQueuedRenderData() {
}
int EchoCancellationImpl::ProcessCaptureAudio(AudioBuffer* audio) {
+ RTC_DCHECK(capture_thread_->CalledOnValidThread());
if (!is_component_enabled()) {
return apm_->kNoError;
}
@@ -445,6 +452,7 @@ 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