From 42d7f83904b8a91ce33e87a44de109572679ac1f Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 2 Jul 2010 08:00:52 -0700 Subject: Add an option to ALooper::start that allows it to call back into java or not. Change-Id: Iec172901a04a575d8d350bd162565f04677c3f26 --- media/libstagefright/foundation/ALooper.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'media/libstagefright/foundation') diff --git a/media/libstagefright/foundation/ALooper.cpp b/media/libstagefright/foundation/ALooper.cpp index 831fa2a..cd4f349 100644 --- a/media/libstagefright/foundation/ALooper.cpp +++ b/media/libstagefright/foundation/ALooper.cpp @@ -31,8 +31,9 @@ namespace android { ALooperRoster gLooperRoster; struct ALooper::LooperThread : public Thread { - LooperThread(ALooper *looper) - : mLooper(looper) { + LooperThread(ALooper *looper, bool canCallJava) + : Thread(canCallJava), + mLooper(looper) { } virtual bool threadLoop() { @@ -72,7 +73,7 @@ void ALooper::unregisterHandler(handler_id handlerID) { gLooperRoster.unregisterHandler(handlerID); } -status_t ALooper::start(bool runOnCallingThread) { +status_t ALooper::start(bool runOnCallingThread, bool canCallJava) { if (runOnCallingThread) { { Mutex::Autolock autoLock(mLock); @@ -96,7 +97,7 @@ status_t ALooper::start(bool runOnCallingThread) { return INVALID_OPERATION; } - mThread = new LooperThread(this); + mThread = new LooperThread(this, canCallJava); status_t err = mThread->run("ALooper"); if (err != OK) { -- cgit v1.1