diff options
author | Lajos Molnar <lajos@google.com> | 2015-07-20 15:34:11 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-07-20 16:00:51 -0700 |
commit | 7c77f9ca649f321374118937bcdaca14a7e5684b (patch) | |
tree | 449e3f65ccce32258d05ad95f37c68a0f47dd48a /media | |
parent | 84e4987ffc8d4bb6731bcb28d69a7ff37a0e9921 (diff) | |
download | frameworks_av-7c77f9ca649f321374118937bcdaca14a7e5684b.zip frameworks_av-7c77f9ca649f321374118937bcdaca14a7e5684b.tar.gz frameworks_av-7c77f9ca649f321374118937bcdaca14a7e5684b.tar.bz2 |
stagefright: allow access of 32-bit pointers from 64-bit code
Bug: 22512621
Change-Id: I19f3fc92ef597029d4ae7e1cd9ca19f21661d2db
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index cebd577..4e1f094 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1400,7 +1400,7 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { ALOGV("replaced oldest buffer #%u with age %u (%p/%p stored in %p)", (unsigned)(oldest - &mBuffers[kPortIndexOutput][0]), mDequeueCounter - oldest->mDequeuedAt, - grallocMeta->pHandle, + (void *)(uintptr_t)grallocMeta->pHandle, oldest->mGraphicBuffer->handle, oldest->mData->base()); } else if (mOutputMetadataType == kMetadataBufferTypeANWBuffer) { VideoNativeMetadata *nativeMeta = @@ -1408,7 +1408,7 @@ ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { ALOGV("replaced oldest buffer #%u with age %u (%p/%p stored in %p)", (unsigned)(oldest - &mBuffers[kPortIndexOutput][0]), mDequeueCounter - oldest->mDequeuedAt, - nativeMeta->pBuffer, + (void *)(uintptr_t)nativeMeta->pBuffer, oldest->mGraphicBuffer->getNativeBuffer(), oldest->mData->base()); } @@ -4034,7 +4034,7 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify) { sizeof(describeParams.sMediaImage))); MediaImage *img = &describeParams.sMediaImage; - ALOGV("[%s] MediaImage { F(%zux%zu) @%zu+%zu+%zu @%zu+%zu+%zu @%zu+%zu+%zu }", + ALOGV("[%s] MediaImage { F(%ux%u) @%u+%u+%u @%u+%u+%u @%u+%u+%u }", mComponentName.c_str(), img->mWidth, img->mHeight, img->mPlane[0].mOffset, img->mPlane[0].mColInc, img->mPlane[0].mRowInc, img->mPlane[1].mOffset, img->mPlane[1].mColInc, img->mPlane[1].mRowInc, @@ -5144,10 +5144,15 @@ bool ACodec::BaseState::onOMXFillBufferDone( VideoNativeMetadata &nativeMeta = *(VideoNativeMetadata *)info->mData->data(); if (info->mData->size() >= sizeof(grallocMeta) && grallocMeta.eType == kMetadataBufferTypeGrallocSource) { - handle = (native_handle_t *)grallocMeta.pHandle; + handle = (native_handle_t *)(uintptr_t)grallocMeta.pHandle; } else if (info->mData->size() >= sizeof(nativeMeta) && nativeMeta.eType == kMetadataBufferTypeANWBuffer) { +#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS + // ANativeWindowBuffer is only valid on 32-bit/mediaserver process + handle = NULL; +#else handle = (native_handle_t *)nativeMeta.pBuffer->handle; +#endif } info->mData->meta()->setPointer("handle", handle); info->mData->meta()->setInt32("rangeOffset", rangeOffset); |