summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChad Jones <chadj@google.com>2015-03-05 19:35:14 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-05 19:35:15 +0000
commitb9a468eb193a374bf82279817aa592b3f5901c98 (patch)
treedda18c7faed40caca2b90bd6019a7595be417990 /media
parent54b804fa742e44a0bc7dccc2784b3322c7b92f19 (diff)
parentc02977e3bbfaaedcb1b1d67e1692becc7dddd59b (diff)
downloadframeworks_base-b9a468eb193a374bf82279817aa592b3f5901c98.zip
frameworks_base-b9a468eb193a374bf82279817aa592b3f5901c98.tar.gz
frameworks_base-b9a468eb193a374bf82279817aa592b3f5901c98.tar.bz2
Merge "Revert "Cleanup Bitmap JNI""
Diffstat (limited to 'media')
-rw-r--r--media/jni/android_media_MediaMetadataRetriever.cpp8
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) {