diff options
author | Chad Jones <chadj@google.com> | 2015-03-05 19:34:26 +0000 |
---|---|---|
committer | Chad Jones <chadj@google.com> | 2015-03-05 19:34:26 +0000 |
commit | c02977e3bbfaaedcb1b1d67e1692becc7dddd59b (patch) | |
tree | 24564767d59138f5c039efefe4744ee35c23ac7e /media | |
parent | b2915245b74b3b5541b123e38403f8e26426b4b7 (diff) | |
download | frameworks_base-c02977e3bbfaaedcb1b1d67e1692becc7dddd59b.zip frameworks_base-c02977e3bbfaaedcb1b1d67e1692becc7dddd59b.tar.gz frameworks_base-c02977e3bbfaaedcb1b1d67e1692becc7dddd59b.tar.bz2 |
Revert "Cleanup Bitmap JNI"
This reverts commit b2915245b74b3b5541b123e38403f8e26426b4b7.
Change-Id: Idd7d7f33eec4ea5024c83de6b10d3d1a6ab2b17a
Diffstat (limited to 'media')
-rw-r--r-- | media/jni/android_media_MediaMetadataRetriever.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp index 2f6bbf4..93138fa 100644 --- a/media/jni/android_media_MediaMetadataRetriever.cpp +++ b/media/jni/android_media_MediaMetadataRetriever.cpp @@ -40,6 +40,7 @@ using namespace android; struct fields_t { jfieldID context; jclass bitmapClazz; // Must be a global ref + jfieldID nativeBitmap; jmethodID createBitmapMethod; jmethodID createScaledBitmapMethod; jclass configClazz; // Must be a global ref @@ -281,7 +282,8 @@ static jobject android_media_MediaMetadataRetriever_getFrameAtTime(JNIEnv *env, return NULL; } - SkBitmap *bitmap = GraphicsJNI::getSkBitmap(env, jBitmap); + SkBitmap *bitmap = + (SkBitmap *) env->GetLongField(jBitmap, fields.nativeBitmap); bitmap->lockPixels(); rotate((uint16_t*)bitmap->getPixels(), @@ -419,6 +421,10 @@ static void android_media_MediaMetadataRetriever_native_init(JNIEnv *env) if (fields.createScaledBitmapMethod == NULL) { return; } + fields.nativeBitmap = env->GetFieldID(fields.bitmapClazz, "mNativeBitmap", "J"); + if (fields.nativeBitmap == NULL) { + return; + } jclass configClazz = env->FindClass("android/graphics/Bitmap$Config"); if (configClazz == NULL) { |