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

Unified Diff: webrtc/modules/audio_processing/echo_control_mobile_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_control_mobile_impl.cc
diff --git a/webrtc/modules/audio_processing/echo_control_mobile_impl.cc b/webrtc/modules/audio_processing/echo_control_mobile_impl.cc
index 420039c9ec8732a31edefa5c46308fc50716f2d1..b2cd5c6cd2c7404348275ea92655a2ceaf5a079b 100644
--- a/webrtc/modules/audio_processing/echo_control_mobile_impl.cc
+++ b/webrtc/modules/audio_processing/echo_control_mobile_impl.cc
@@ -66,10 +66,14 @@ size_t EchoControlMobile::echo_path_size_bytes() {
}
EchoControlMobileImpl::EchoControlMobileImpl(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),
routing_mode_(kSpeakerphone),
comfort_noise_enabled_(true),
external_echo_path_(NULL),
@@ -85,6 +89,7 @@ EchoControlMobileImpl::~EchoControlMobileImpl() {
}
int EchoControlMobileImpl::ProcessRenderAudio(const AudioBuffer* audio) {
+ RTC_DCHECK(render_thread_->CalledOnValidThread());
if (!is_component_enabled()) {
return apm_->kNoError;
}
@@ -131,6 +136,7 @@ int EchoControlMobileImpl::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 EchoControlMobileImpl::ReadQueuedRenderData() {
+ RTC_DCHECK(capture_thread_->CalledOnValidThread());
if (!is_component_enabled()) {
return;
}
@@ -157,6 +163,7 @@ void EchoControlMobileImpl::ReadQueuedRenderData() {
}
int EchoControlMobileImpl::ProcessCaptureAudio(AudioBuffer* audio) {
+ RTC_DCHECK(capture_thread_->CalledOnValidThread());
if (!is_component_enabled()) {
return apm_->kNoError;
}

Powered by Google App Engine
This is Rietveld 408576698