#ifdef USE_ANB
if (exynosOutputPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_LockANB(pOutputBuf, nImageWidth, nImageHeight, eColorFormat, &stride, planes);
+ Exynos_OSAL_LockANBHandle(pOutputBuf, nImageWidth, nImageHeight, eColorFormat, &stride, planes);
nImageWidth = stride;
outputUseBuffer->dataLen = sizeof(void *);
#ifdef USE_ANB
if (exynosOutputPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_UnlockANB(pOutputBuf);
+ Exynos_OSAL_UnlockANBHandle(pOutputBuf);
}
#endif
} else if (portIndex == OUTPUT_PORT_INDEX) {
#ifdef USE_ANB
if (pExynosPort->bIsANBEnabled == OMX_TRUE)
- Exynos_OSAL_UnlockANB(pExynosPort->processData.bufferHeader->pBuffer);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)pExynosPort->processData.bufferHeader->pBuffer);
#endif
Exynos_OMX_OutputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader);
}
if (portIndex == OUTPUT_PORT_INDEX) {
#ifdef USE_ANB
if (pExynosPort->bIsANBEnabled == OMX_TRUE)
- Exynos_OSAL_UnlockANB(pExynosPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)pExynosPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
#endif
Exynos_OMX_OutputBufferReturn(pOMXComponent, pExynosPort->extendBufferHeader[i].OMXBufferHeader);
} else if (portIndex == INPUT_PORT_INDEX) {
if ((pUseBuffer->bufferHeader != NULL) &&
(pUseBuffer->bufferHeader->pBuffer != NULL) &&
(pExynosPort->exceptionFlag == GENERAL_STATE)) {
- 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);
pUseBuffer->dataLen = sizeof(void *);
} else {
ret = OMX_ErrorBadParameter;
}
if (pExynosPort->bIsANBEnabled == OMX_TRUE) {
- Exynos_OSAL_UnlockANB(pUseBuffer->bufferHeader->pBuffer);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)pUseBuffer->bufferHeader->pBuffer);
} else {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
ret = OMX_ErrorBadParameter;
/* kMetadataBufferTypeGrallocSource */
/* ARGB8888 converted to YUV420SemiPlanar */
ExynosVideoPlane planes[MAX_BUFFER_PLANE];
+ OMX_U32 stride;
csc_src_color_format = omx_2_hal_pixel_format((unsigned int)OMX_COLOR_Format32bitARGB8888);
csc_dst_color_format = omx_2_hal_pixel_format((unsigned int)OMX_COLOR_FormatYUV420SemiPlanar);
codecInputBuffer->dataSize += nPlaneSize[i];
csc_src_color_format = omx_2_hal_pixel_format((unsigned int)pVideoEnc->ANBColorFormat);
- if (OMX_ErrorNone != Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatAndroidOpaque, planes)) {
+ if (OMX_ErrorNone != Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatAndroidOpaque, &stride, planes)) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: Exynos_OSAL_LockANBHandle() failed", __FUNCTION__);
ret = OMX_FALSE;
goto EXIT;
#ifdef USE_DMA_BUF
if (eColorFormat == OMX_COLOR_FormatAndroidOpaque) {
ExynosVideoPlane planes[MAX_BUFFER_PLANE];
+ OMX_U32 stride;
- 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);
for (plane = 0; plane < exynosInputPort->nPlaneCnt; plane++) {
srcInputData->buffer.multiPlaneBuffer.fd[plane] = planes[plane].fd;
OMX_PTR ppBuf[MAX_BUFFER_PLANE];
if (OMX_ErrorNone ==
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pExynosPort->processData.bufferHeader->pBuffer, ppBuf))
- Exynos_OSAL_UnlockANBHandle(ppBuf[0]);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)ppBuf[0]);
}
#endif
Exynos_OMX_InputBufferReturn(pOMXComponent, pExynosPort->processData.bufferHeader);
OMX_PTR ppBuf[MAX_BUFFER_PLANE];
if (OMX_ErrorNone ==
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pExynosPort->extendBufferHeader[i].OMXBufferHeader->pBuffer, ppBuf))
- Exynos_OSAL_UnlockANBHandle(ppBuf[0]);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)ppBuf[0]);
}
#endif
Exynos_OMX_InputBufferReturn(pOMXComponent,
OMX_PTR ppBuf[MAX_BUFFER_PLANE];
if (OMX_ErrorNone ==
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)pUseBuffer->bufferHeader->pBuffer, ppBuf))
- Exynos_OSAL_UnlockANBHandle(ppBuf[0]);
+ Exynos_OSAL_UnlockANBHandle((OMX_U32)ppBuf[0]);
}
return ret;
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[1].addr = vaddr[1];
vplanes[2].addr = vaddr[2];
+ *pStride = priv_hnd->stride;
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer locked: 0x%x", __func__, *vaddr);
EXIT:
return ret;
}
-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 useAndroidNativeBuffer(
EXYNOS_OMX_BASEPORT *pExynosPort,
OMX_BUFFERHEADERTYPE **ppBufferHdr,
for (i = 0; i < pExynosPort->portDefinition.nBufferCountActual; i++) {
if (pExynosPort->bufferStateAllocate[i] == BUFFER_STATE_FREE) {
+ OMX_U32 stride;
+
pExynosPort->extendBufferHeader[i].OMXBufferHeader = temp_bufferHeader;
pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ASSIGNED | HEADER_STATE_ALLOCATED);
INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE);
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);
#ifdef USE_DMA_BUF
pExynosPort->extendBufferHeader[i].pYUVBuf[0] = planes[0].addr;
pExynosPort->extendBufferHeader[i].pYUVBuf[1] = planes[1].addr;
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 , pYUVBuf[1]:0x%x ",
i, pExynosPort->extendBufferHeader[i].pYUVBuf[0],
pExynosPort->extendBufferHeader[i].pYUVBuf[1]);
OMX_COLOR_FORMATTYPE Exynos_OSAL_GetANBColorFormat(OMX_IN OMX_U32 handle);
-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);
-
-OMX_ERRORTYPE Exynos_OSAL_UnlockANB(OMX_IN OMX_PTR pBuffer);
-
OMX_ERRORTYPE Exynos_OSAL_LockANBHandle(OMX_IN OMX_U32 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);
OMX_ERRORTYPE Exynos_OSAL_UnlockANBHandle(OMX_IN OMX_U32 pBuffer);