diff options
author | John Reck <jreck@google.com> | 2015-04-10 13:52:57 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-04-30 12:46:57 -0700 |
commit | ed207b92747234eac88dd3664ecfb535e45d8ed1 (patch) | |
tree | 1dbef1ad7b0dc01fbcbb2da189c6824005153c4e /media | |
parent | b77a7551121561f4ea7d5ce0c4030aeb7ce709e8 (diff) | |
download | frameworks_base-ed207b92747234eac88dd3664ecfb535e45d8ed1.zip frameworks_base-ed207b92747234eac88dd3664ecfb535e45d8ed1.tar.gz frameworks_base-ed207b92747234eac88dd3664ecfb535e45d8ed1.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
Attempt #2 to land this, original issue was in getSkBitmap
and should be fixed
Change-Id: I0fd9e193968b41e5597784140d56b4885906864a
Diffstat (limited to 'media')
-rw-r--r-- | media/jni/android_media_MediaMetadataRetriever.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp index 88a6771..59fb6d6 100644 --- a/media/jni/android_media_MediaMetadataRetriever.cpp +++ b/media/jni/android_media_MediaMetadataRetriever.cpp @@ -299,15 +299,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) { |