summaryrefslogtreecommitdiffstats
path: root/media/jni
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-04-10 13:52:57 -0700
committerJohn Reck <jreck@google.com>2015-04-13 09:50:42 -0700
commita771b9861d11671c780092d35c0062eeefcf37c0 (patch)
treea575dc870712330cb8ddc70b5dccd0df26806a6a /media/jni
parent4147877b388eb4a6f4e1ee116edfa58a018891ca (diff)
downloadframeworks_base-a771b9861d11671c780092d35c0062eeefcf37c0.zip
frameworks_base-a771b9861d11671c780092d35c0062eeefcf37c0.tar.gz
frameworks_base-a771b9861d11671c780092d35c0062eeefcf37c0.tar.bz2
Change how Java Bitmaps are accessed in a few places
Stop assuming that a Java Bitmap has a SkBitmap* that has some externally managed lifecycle, and instead switch a bunch of users to accessing the bitmap by providing their own SkBitmap* on which to set the (ref counted!) SkPixelRef* instead Change-Id: I0fd9e193968b41e5597784140d56b4885906864a
Diffstat (limited to 'media/jni')
-rw-r--r--media/jni/android_media_MediaMetadataRetriever.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index 2f6bbf4..c6fa379 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -281,15 +281,16 @@ static jobject android_media_MediaMetadataRetriever_getFrameAtTime(JNIEnv *env,
return NULL;
}
- SkBitmap *bitmap = GraphicsJNI::getSkBitmap(env, jBitmap);
+ SkBitmap bitmap;
+ GraphicsJNI::getSkBitmap(env, jBitmap, &bitmap);
- bitmap->lockPixels();
- rotate((uint16_t*)bitmap->getPixels(),
+ bitmap.lockPixels();
+ rotate((uint16_t*)bitmap.getPixels(),
(uint16_t*)((char*)videoFrame + sizeof(VideoFrame)),
videoFrame->mWidth,
videoFrame->mHeight,
videoFrame->mRotationAngle);
- bitmap->unlockPixels();
+ bitmap.unlockPixels();
if (videoFrame->mDisplayWidth != videoFrame->mWidth ||
videoFrame->mDisplayHeight != videoFrame->mHeight) {