diff options
author | Dave Sparks <davidsparks@android.com> | 2010-04-01 18:00:58 -0700 |
---|---|---|
committer | Dave Sparks <davidsparks@android.com> | 2010-04-01 18:08:22 -0700 |
commit | db6cc0ba71a873ad0258e850cb939639b7857c26 (patch) | |
tree | 910304658bb8d40a41f135a0874a518b15014391 /media/jni/android_media_MediaMetadataRetriever.cpp | |
parent | e11bafec8d6c887c6ae95fa3d39c202859e86d48 (diff) | |
download | frameworks_base-db6cc0ba71a873ad0258e850cb939639b7857c26.zip frameworks_base-db6cc0ba71a873ad0258e850cb939639b7857c26.tar.gz frameworks_base-db6cc0ba71a873ad0258e850cb939639b7857c26.tar.bz2 |
Use local lock for most MediaMetadataRetriever methods. Bug 2560834.
MediaMetadataRetriever uses a single static lock for all operations.
This effectively serializes all metadata retrieval operations in a
single process. This patch uses the object level lock for all normal
operations and only uses the static lock to serialize calls to
release.
Change-Id: I81c9f234c2f0007a26d18e1398c709b41a4dbbd7
Diffstat (limited to 'media/jni/android_media_MediaMetadataRetriever.cpp')
-rw-r--r-- | media/jni/android_media_MediaMetadataRetriever.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp index 3e9ba33..efea802 100644 --- a/media/jni/android_media_MediaMetadataRetriever.cpp +++ b/media/jni/android_media_MediaMetadataRetriever.cpp @@ -76,7 +76,6 @@ static void setRetriever(JNIEnv* env, jobject thiz, int retriever) static void android_media_MediaMetadataRetriever_setDataSource(JNIEnv *env, jobject thiz, jstring path) { LOGV("setDataSource"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); @@ -105,7 +104,6 @@ static void android_media_MediaMetadataRetriever_setDataSource(JNIEnv *env, jobj static void android_media_MediaMetadataRetriever_setDataSourceFD(JNIEnv *env, jobject thiz, jobject fileDescriptor, jlong offset, jlong length) { LOGV("setDataSource"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); @@ -135,7 +133,6 @@ static void android_media_MediaMetadataRetriever_setDataSourceFD(JNIEnv *env, jo static void android_media_MediaMetadataRetriever_setMode(JNIEnv *env, jobject thiz, jint mode) { LOGV("setMode"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); @@ -147,7 +144,6 @@ static void android_media_MediaMetadataRetriever_setMode(JNIEnv *env, jobject th static int android_media_MediaMetadataRetriever_getMode(JNIEnv *env, jobject thiz) { LOGV("getMode"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); @@ -161,7 +157,6 @@ static int android_media_MediaMetadataRetriever_getMode(JNIEnv *env, jobject thi static jobject android_media_MediaMetadataRetriever_captureFrame(JNIEnv *env, jobject thiz) { LOGV("captureFrame"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); @@ -202,7 +197,6 @@ static jobject android_media_MediaMetadataRetriever_captureFrame(JNIEnv *env, jo static jbyteArray android_media_MediaMetadataRetriever_extractAlbumArt(JNIEnv *env, jobject thiz) { LOGV("extractAlbumArt"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); @@ -238,7 +232,6 @@ static jbyteArray android_media_MediaMetadataRetriever_extractAlbumArt(JNIEnv *e static jobject android_media_MediaMetadataRetriever_extractMetadata(JNIEnv *env, jobject thiz, jint keyCode) { LOGV("extractMetadata"); - Mutex::Autolock lock(sLock); MediaMetadataRetriever* retriever = getRetriever(env, thiz); if (retriever == 0) { jniThrowException(env, "java/lang/IllegalStateException", "No retriever available"); |