summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominggoes Isakh <drjisakh@gmail.com>2018-03-02 18:56:54 +0100
committerDominggoes Isakh <drjisakh@gmail.com>2018-03-02 18:56:54 +0100
commit131de54db18e8af255629c71bff01ae7eb5804b4 (patch)
tree358c637fba280bc05436d7070f0452a50f8625b2
parentbd8186204859742ee1c535ec6ff6ba8ccc9ef95b (diff)
downloadhardware_samsung-staging/lineage-15.1.tar.gz
hardware_samsung-staging/lineage-15.1.tar.bz2
hardware_samsung-staging/lineage-15.1.zip
exynos4: Fix GRALLOC_USAGE_YUV_ADDR for hardware decodersstaging/lineage-15.1
Change-Id: I07206502e9dcdd731ce19eaf1e14ac519afab01e
-rw-r--r--exynos/multimedia/openmax/osal/SEC_OSAL_Android.cpp8
-rw-r--r--exynos4/hal/libgralloc_ump/gralloc_module.cpp10
2 files changed, 15 insertions, 3 deletions
diff --git a/exynos/multimedia/openmax/osal/SEC_OSAL_Android.cpp b/exynos/multimedia/openmax/osal/SEC_OSAL_Android.cpp
index 4ba8bdb..348808e 100644
--- a/exynos/multimedia/openmax/osal/SEC_OSAL_Android.cpp
+++ b/exynos/multimedia/openmax/osal/SEC_OSAL_Android.cpp
@@ -242,6 +242,14 @@ OMX_ERRORTYPE SEC_OSAL_LockANB(
android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer;
ret = SEC_OSAL_LockANBHandle((OMX_U32)pANB->handle, width, height, format, vaddr);
+
+ // Extract pointers for YUV-adresses and free memory
+ void **pAddr = (void **)vaddr[0];
+ vaddr[0] = pAddr[0];
+ vaddr[1] = pAddr[1];
+ vaddr[2] = pAddr[2];
+ free(pAddr);
+
*pStride = pANB->stride;
EXIT:
diff --git a/exynos4/hal/libgralloc_ump/gralloc_module.cpp b/exynos4/hal/libgralloc_ump/gralloc_module.cpp
index ebd0ec1..d32e4c7 100644
--- a/exynos4/hal/libgralloc_ump/gralloc_module.cpp
+++ b/exynos4/hal/libgralloc_ump/gralloc_module.cpp
@@ -31,6 +31,7 @@
//#define LOG_NDEBUG 0
#include <errno.h>
#include <pthread.h>
+#include <stdlib.h>
#include <sys/mman.h>
#include <cutils/log.h>
@@ -401,9 +402,12 @@ static int gralloc_lock(gralloc_module_t const* module, buffer_handle_t handle,
*vaddr = (void*)hnd->base;
if (usage & GRALLOC_USAGE_YUV_ADDR) {
- vaddr[0] = (void*)hnd->base;
- vaddr[1] = (void*)(hnd->base + hnd->uoffset);
- vaddr[2] = (void*)(hnd->base + hnd->uoffset + hnd->voffset);
+ // Create pointer to 3 pointers for YUV addresses
+ void** pAddr = (void **) malloc(3 * sizeof(void *));
+ pAddr[0] = (void*)hnd->base;
+ pAddr[1] = (void*)(hnd->base + hnd->uoffset);
+ pAddr[2] = (void*)(hnd->base + hnd->uoffset + hnd->voffset);
+ *vaddr = pAddr;
}
return err;
}