From: Danny Wood Date: Fri, 10 Apr 2020 19:42:22 +0000 (+0100) Subject: osal: add procssing of kMetadataBufferTypeNativeHandleSource metadata X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=27368d985abeef2b49e3fdd421fb2851e95eae73;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git osal: add procssing of kMetadataBufferTypeNativeHandleSource metadata Change-Id: Id64f6728c5d74a266be2ef525ba5d220b51125ea (cherry picked from commit 5ace56ac6fb8b0857fd9c882bbb7bf0975cc23f9) --- diff --git a/osal/Exynos_OSAL_Android.cpp b/osal/Exynos_OSAL_Android.cpp index 2402479..bb2baac 100644 --- a/osal/Exynos_OSAL_Android.cpp +++ b/osal/Exynos_OSAL_Android.cpp @@ -1037,6 +1037,12 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(OMX_IN OMX_BYTE pBuffer, * --------------------------------------------------------------- * | kMetadataBufferTypeGrallocSource | buffer_handle_t | * --------------------------------------------------------------- + * + * If MetadataBufferType is kMetadataBufferTypeNativeHandleSource, then + * --------------------------------------------------------------- + * | kMetadataBufferTypeNativeHandleSource | native_handle_t* | + * --------------------------------------------------------------- + * */ /* MetadataBufferType */ @@ -1072,6 +1078,23 @@ OMX_ERRORTYPE Exynos_OSAL_GetInfoFromMetaData(OMX_IN OMX_BYTE pBuffer, ret = OMX_ErrorBadParameter; } } + break; + case kMetadataBufferTypeNativeHandleSource: + { + native_handle_t* pNativeHandle; + + /* native_handle_t */ + Exynos_OSAL_Memcpy(&pNativeHandle, pBuffer + sizeof(MetadataBufferType), sizeof(native_handle_t*)); + + ppBuf[0] = INT_TO_PTR(pNativeHandle->data[0]); + ppBuf[1] = INT_TO_PTR(pNativeHandle->data[1]); + + if (ppBuf[0] == NULL || ppBuf[1] == NULL) { + Exynos_OSAL_Log(EXYNOS_LOG_WARNING, "NativeHandle's fd is NULL"); + ret = OMX_ErrorBadParameter; + } + } + break; default: {