summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/NuCachedSource2.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2014-01-29 11:13:26 -0800
committerAndreas Huber <andih@google.com>2014-02-04 15:11:53 -0800
commit1b86fe063badb5f28c467ade39be0f4008688947 (patch)
treed88660112d407540184ad8e1292ed8aa98fae317 /media/libstagefright/NuCachedSource2.cpp
parent5ce88270eb2d41462de8c4155673b802b2ca48cb (diff)
downloadframeworks_av-1b86fe063badb5f28c467ade39be0f4008688947.zip
frameworks_av-1b86fe063badb5f28c467ade39be0f4008688947.tar.gz
frameworks_av-1b86fe063badb5f28c467ade39be0f4008688947.tar.bz2
FINAL ATTEMPT: HTTP services are now provided from JAVA and made available to media code
Change-Id: I9f74a86e70422187c9cf0ca1318a29019700192d
Diffstat (limited to 'media/libstagefright/NuCachedSource2.cpp')
-rw-r--r--media/libstagefright/NuCachedSource2.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp
index 05e599b..1287fb1 100644
--- a/media/libstagefright/NuCachedSource2.cpp
+++ b/media/libstagefright/NuCachedSource2.cpp
@@ -213,7 +213,14 @@ NuCachedSource2::NuCachedSource2(
mLooper->setName("NuCachedSource2");
mLooper->registerHandler(mReflector);
- mLooper->start();
+
+ // Since it may not be obvious why our looper thread needs to be
+ // able to call into java since it doesn't appear to do so at all...
+ // IMediaHTTPConnection may be (and most likely is) implemented in JAVA
+ // and a local JAVA IBinder will call directly into JNI methods.
+ // So whenever we call DataSource::readAt it may end up in a call to
+ // IMediaHTTPConnection::readAt and therefore call back into JAVA.
+ mLooper->start(false /* runOnCallingThread */, true /* canCallJava */);
Mutex::Autolock autoLock(mLock);
(new AMessage(kWhatFetchMore, mReflector->id()))->post();