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

Unified Diff: talk/app/webrtc/test/fakeaudiocapturemodule.cc

Issue 1236023010: In PeerConnectionTestWrapper, put audio input on a separate thread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing potential deadlock in FakeAudioCaptureModule, caused by unnecessary call to Thread::Send Created 5 years, 5 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: talk/app/webrtc/test/fakeaudiocapturemodule.cc
diff --git a/talk/app/webrtc/test/fakeaudiocapturemodule.cc b/talk/app/webrtc/test/fakeaudiocapturemodule.cc
index 47f17a1739abe566a38bad9d14ebdfa24b0507d2..065ef25426c42f5c47018cee3f9292197f6d5e11 100644
--- a/talk/app/webrtc/test/fakeaudiocapturemodule.cc
+++ b/talk/app/webrtc/test/fakeaudiocapturemodule.cc
@@ -54,7 +54,6 @@ static const uint32_t kMaxVolume = 14392;
enum {
MSG_START_PROCESS,
MSG_RUN_PROCESS,
- MSG_STOP_PROCESS,
};
FakeAudioCaptureModule::FakeAudioCaptureModule(
@@ -74,7 +73,7 @@ FakeAudioCaptureModule::FakeAudioCaptureModule(
FakeAudioCaptureModule::~FakeAudioCaptureModule() {
// Ensure that thread stops calling ProcessFrame().
- process_thread_->Send(this, MSG_STOP_PROCESS);
+ process_thread_->Clear(this);
}
rtc::scoped_refptr<FakeAudioCaptureModule> FakeAudioCaptureModule::Create(
@@ -601,9 +600,6 @@ void FakeAudioCaptureModule::OnMessage(rtc::Message* msg) {
case MSG_RUN_PROCESS:
ProcessFrameP();
break;
- case MSG_STOP_PROCESS:
- StopProcessP();
- break;
default:
// All existing messages should be caught. Getting here should never
// happen.
@@ -652,7 +648,8 @@ void FakeAudioCaptureModule::UpdateProcessing(bool start) {
if (start) {
process_thread_->Post(this, MSG_START_PROCESS);
} else {
- process_thread_->Send(this, MSG_STOP_PROCESS);
+ process_thread_->Clear(this);
+ started_ = false;
}
}
@@ -747,8 +744,3 @@ void FakeAudioCaptureModule::SendFrameP() {
SetMicrophoneVolume(current_mic_level);
}
-void FakeAudioCaptureModule::StopProcessP() {
- ASSERT(rtc::Thread::Current() == process_thread_);
- started_ = false;
- process_thread_->Clear(this);
-}

Powered by Google App Engine
This is Rietveld 408576698