summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-07-02 10:02:17 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-07-02 10:02:17 -0700
commit34bbea84b8374f5d0ebe72b0be4418ace984fac0 (patch)
tree3e933eb60e037a7c91e007eea606b1d9ae9b868f
parentcbb56d14dad2785baf7a723b43aa6f1da32dc51f (diff)
parent42d7f83904b8a91ce33e87a44de109572679ac1f (diff)
downloadframeworks_av-34bbea84b8374f5d0ebe72b0be4418ace984fac0.zip
frameworks_av-34bbea84b8374f5d0ebe72b0be4418ace984fac0.tar.gz
frameworks_av-34bbea84b8374f5d0ebe72b0be4418ace984fac0.tar.bz2
Merge "Add an option to ALooper::start that allows it to call back into java or not." into gingerbread
-rw-r--r--include/media/stagefright/foundation/ALooper.h5
-rw-r--r--media/libstagefright/foundation/ALooper.cpp9
2 files changed, 9 insertions, 5 deletions
diff --git a/include/media/stagefright/foundation/ALooper.h b/include/media/stagefright/foundation/ALooper.h
index 69ad837..194f1fc 100644
--- a/include/media/stagefright/foundation/ALooper.h
+++ b/include/media/stagefright/foundation/ALooper.h
@@ -39,7 +39,10 @@ struct ALooper : public RefBase {
handler_id registerHandler(const sp<AHandler> &handler);
void unregisterHandler(handler_id handlerID);
- status_t start(bool runOnCallingThread = false);
+ status_t start(
+ bool runOnCallingThread = false,
+ bool canCallJava = false);
+
status_t stop();
static int64_t GetNowUs();
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) {