ExynosVideoPlane planes[MAX_BUFFER_PLANE];
OMX_U32 stride;
if (exynosOutputPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_LockANB(pOutputBuf, width, height, exynosOutputPort->portDefinition.format.video.eColorFormat, &stride, planes);
+ Exynos_OSAL_LockANBHandle(pOutputBuf, width, height, exynosOutputPort->portDefinition.format.video.eColorFormat, &stride, planes);
} else if (exynosOutputPort->bStoreMetaData == OMX_TRUE) {
Exynos_OSAL_LockMetaData(pOutputBuf, width, height, exynosOutputPort->portDefinition.format.video.eColorFormat, &stride, planes);
}
#ifdef USE_ANB
if (exynosOutputPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_UnlockANB(pOutputBuf);
+ Exynos_OSAL_UnlockANBHandle(pOutputBuf);
} else if (exynosOutputPort->bStoreMetaData == OMX_TRUE) {
Exynos_OSAL_UnlockMetaData(pOutputBuf);
}
OMX_U32 stride;
if ((pUseBuffer->bufferHeader != NULL) && (pUseBuffer->bufferHeader->pBuffer != NULL)) {
if (pExynosPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_LockANB(pUseBuffer->bufferHeader->pBuffer, width, height, pExynosPort->portDefinition.format.video.eColorFormat, &stride, planes);
+ Exynos_OSAL_LockANBHandle(pUseBuffer->bufferHeader->pBuffer, width, height, pExynosPort->portDefinition.format.video.eColorFormat, &stride, planes);
} else if (pExynosPort->bStoreMetaData == OMX_TRUE) {
Exynos_OSAL_LockMetaData(pUseBuffer->bufferHeader->pBuffer, width, height, pExynosPort->portDefinition.format.video.eColorFormat, &stride, planes);
}
}
if (pExynosPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_UnlockANB(pUseBuffer->bufferHeader->pBuffer);
+ Exynos_OSAL_UnlockANBHandle(pUseBuffer->bufferHeader->pBuffer);
} else if (pExynosPort->bStoreMetaData == OMX_TRUE) {
Exynos_OSAL_UnlockMetaData(pUseBuffer->bufferHeader->pBuffer);
} else {
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)inputUseBuffer->bufferHeader->pBuffer, ppBuf);
if (eColorFormat == OMX_COLOR_FormatAndroidOpaque) {
ExynosVideoPlane planes[MAX_BUFFER_PLANE];
- size_t i;
+ OMX_U32 stride;
+ int i;
csc_src_color_format = omx_2_hal_pixel_format((unsigned int)Exynos_OSAL_GetANBColorFormat(ppBuf[0]));
- Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatAndroidOpaque, planes);
+ Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatAndroidOpaque, &stride, planes);
#if defined(USE_CSC_GSCALER) || defined(USE_CSC_G2D)
csc_method = CSC_METHOD_HW;
if (eColorFormat == OMX_COLOR_FormatAndroidOpaque) {
ExynosVideoPlane planes[MAX_BUFFER_PLANE];
+ OMX_U32 stride;
- Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatYUV420SemiPlanar, planes);
+ Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatYUV420SemiPlanar, &stride, planes);
srcInputData->buffer.multiPlaneBuffer.fd[0] = planes[0].fd;
srcInputData->buffer.multiPlaneBuffer.fd[1] = planes[1].fd;
OMX_IN OMX_U32 width,
OMX_IN OMX_U32 height,
OMX_IN OMX_COLOR_FORMATTYPE format,
+ OMX_OUT OMX_U32 *pStride,
OMX_OUT OMX_PTR planes)
{
FunctionIn();
vplanes[2].offset = 0;
vplanes[2].addr = vaddr[2];
+ *pStride = priv_hnd->stride;
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer locked: 0x%x", __func__, *vaddr);
EXIT:
return nStride;
}
-OMX_ERRORTYPE Exynos_OSAL_LockANB(
- OMX_IN OMX_PTR pBuffer,
- OMX_IN OMX_U32 width,
- OMX_IN OMX_U32 height,
- OMX_IN OMX_COLOR_FORMATTYPE format,
- OMX_OUT OMX_U32 *pStride,
- OMX_OUT OMX_PTR planes)
-{
- FunctionIn();
-
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer;
-
- ret = Exynos_OSAL_LockANBHandle((OMX_U32)pANB->handle, width, height, format, planes);
- *pStride = pANB->stride;
-
-EXIT:
- FunctionOut();
-
- return ret;
-}
-
-OMX_ERRORTYPE Exynos_OSAL_UnlockANB(OMX_IN OMX_PTR pBuffer)
-{
- FunctionIn();
-
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer;
-
- ret = Exynos_OSAL_UnlockANBHandle((OMX_U32)pANB->handle);
-
-EXIT:
- FunctionOut();
-
- return ret;
-}
-
OMX_ERRORTYPE Exynos_OSAL_LockMetaData(
OMX_IN OMX_PTR pBuffer,
OMX_IN OMX_U32 width,
ret = Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pBuffer, &pBuf);
if (ret == OMX_ErrorNone) {
- ret = Exynos_OSAL_LockANBHandle((OMX_U32)pBuf, width, height, format, planes);
- *pStride = Exynos_OSAL_GetANBStride((OMX_U32)pBuf);
+ ret = Exynos_OSAL_LockANBHandle((OMX_U32)pBuf, width, height, format, pStride, planes);
}
EXIT:
{
int i;
OMX_ERRORTYPE ret = OMX_ErrorNone;
- buffer_handle_t bufferHandle = (buffer_handle_t) pBuffer;//pANB->handle;
+ buffer_handle_t bufferHandle = (buffer_handle_t) pBuffer; //pANB->handle
private_handle_t *priv_hnd = (private_handle_t *) bufferHandle;
EXYNOS_OMX_REF_HANDLE *phREF = (EXYNOS_OMX_REF_HANDLE *)hREF;
gralloc_module_t* module = NULL;
pExynosPort->extendBufferHeader[i].OMXBufferHeader = temp_bufferHeader;
pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ASSIGNED | HEADER_STATE_ALLOCATED);
INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE);
- temp_bufferHeader->pBuffer = pBuffer;
+ android_native_buffer_t *pANB = (android_native_buffer_t *) pBuffer;
+ temp_bufferHeader->pBuffer = (OMX_U8 *)pANB->handle;
temp_bufferHeader->nAllocLen = nSizeBytes;
temp_bufferHeader->pAppPrivate = pAppPrivate;
if (nPortIndex == INPUT_PORT_INDEX)
width = pExynosPort->portDefinition.format.video.nFrameWidth;
height = pExynosPort->portDefinition.format.video.nFrameHeight;
- Exynos_OSAL_LockANB(temp_bufferHeader->pBuffer, width, height,
+ Exynos_OSAL_LockANBHandle((OMX_U32)temp_bufferHeader->pBuffer, width, height,
pExynosPort->portDefinition.format.video.eColorFormat,
&stride, planes);
pExynosPort->extendBufferHeader[i].buf_fd[0] = planes[0].fd;
pExynosPort->extendBufferHeader[i].pYUVBuf[1] = planes[1].addr;
pExynosPort->extendBufferHeader[i].buf_fd[2] = planes[2].fd;
pExynosPort->extendBufferHeader[i].pYUVBuf[2] = planes[2].addr;
- Exynos_OSAL_UnlockANB(temp_bufferHeader->pBuffer);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)temp_bufferHeader->pBuffer);
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "useAndroidNativeBuffer: buf %d pYUVBuf[0]:0x%x (fd:%d), pYUVBuf[1]:0x%x (fd:%d)",
i, pExynosPort->extendBufferHeader[i].pYUVBuf[0], planes[0].fd,
pExynosPort->extendBufferHeader[i].pYUVBuf[1], planes[1].fd);