From a56b45161fe78ba65a146ebe845f4f4370116b57 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Thu, 6 Dec 2012 04:32:25 +0000 Subject: [PATCH] video: fixed missing code for H/W CSC vdec: wrapped unneeded code, if DMA_BUF is used. venc: added ifdef macro. if it isn't there, DstBuf value will be wrong. all: added to set FD value at CodecBufferToData function for H/W CSC. if DMA_BUF is used, needs FD value. Change-Id: Icca36d5a8e80cd7cc0c462416db085af005592bb Signed-off-by: Taehwan Kim --- component/video/dec/Exynos_OMX_Vdec.c | 5 ++++- component/video/enc/Exynos_OMX_Venc.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/component/video/dec/Exynos_OMX_Vdec.c b/component/video/dec/Exynos_OMX_Vdec.c index d68bdf0..234deca 100644 --- a/component/video/dec/Exynos_OMX_Vdec.c +++ b/component/video/dec/Exynos_OMX_Vdec.c @@ -261,6 +261,9 @@ OMX_ERRORTYPE Exynos_Output_CodecBufferToData( pData->buffer.multiPlaneBuffer.dataBuffer[0] = pCodecBuffer->pVirAddr[0]; pData->buffer.multiPlaneBuffer.dataBuffer[1] = pCodecBuffer->pVirAddr[1]; pData->buffer.multiPlaneBuffer.dataBuffer[2] = pCodecBuffer->pVirAddr[2]; + pData->buffer.multiPlaneBuffer.fd[0] = pCodecBuffer->fd[0]; + pData->buffer.multiPlaneBuffer.fd[1] = pCodecBuffer->fd[1]; + pData->buffer.multiPlaneBuffer.fd[2] = pCodecBuffer->fd[2]; pData->allocSize = pCodecBuffer->bufferSize[0] + pCodecBuffer->bufferSize[1] + pCodecBuffer->bufferSize[2]; pData->dataLen = 0; pData->usedDataLen = 0; @@ -338,8 +341,8 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pYUVBuf[1] = (unsigned char *)pOutputBuf + imageSize; pYUVBuf[2] = (unsigned char *)pOutputBuf + imageSize + imageSize / 4; - csc_get_method(pVideoDec->csc_handle, &csc_method); #ifdef USE_DMA_BUF + csc_get_method(pVideoDec->csc_handle, &csc_method); if (csc_method == CSC_METHOD_HW) { pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.fd[0]; pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.fd[1]; diff --git a/component/video/enc/Exynos_OMX_Venc.c b/component/video/enc/Exynos_OMX_Venc.c index 49beb26..1097f73 100644 --- a/component/video/enc/Exynos_OMX_Venc.c +++ b/component/video/enc/Exynos_OMX_Venc.c @@ -104,6 +104,8 @@ OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosCo pData->buffer.multiPlaneBuffer.dataBuffer[0] = pInputCodecBuffer->pVirAddr[0]; pData->buffer.multiPlaneBuffer.dataBuffer[1] = pInputCodecBuffer->pVirAddr[1]; + pData->buffer.multiPlaneBuffer.fd[0] = pInputCodecBuffer->fd[0]; + pData->buffer.multiPlaneBuffer.fd[1] = pInputCodecBuffer->fd[1]; pData->allocSize = pInputCodecBuffer->bufferSize[0] + pInputCodecBuffer->bufferSize[1]; pData->dataLen = pInputCodecBuffer->dataSize; pData->usedDataLen = 0; @@ -124,6 +126,7 @@ OMX_ERRORTYPE Exynos_Output_CodecBufferToData( OMX_ERRORTYPE ret = OMX_ErrorNone; pData->buffer.singlePlaneBuffer.dataBuffer = pCodecBuffer->pVirAddr[0]; + pData->buffer.singlePlaneBuffer.fd = pCodecBuffer->fd[0]; pData->allocSize = pCodecBuffer->bufferSize[0]; pData->dataLen = 0; pData->usedDataLen = 0; @@ -200,12 +203,14 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.dataBuffer[1]; pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.dataBuffer[2]; +#ifdef USE_DMA_BUF csc_get_method(pVideoEnc->csc_handle, &csc_method); if (csc_method == CSC_METHOD_HW) { pDstBuf[0] = srcInputData->buffer.multiPlaneBuffer.fd[0]; pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.fd[1]; pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.fd[2]; } +#endif #ifdef USE_METADATABUFFERTYPE OMX_PTR ppBuf[MAX_BUFFER_PLANE]; -- 2.20.1