- Use MFC_INPUT_BUFFER_PLANE.
- Use MFC_OUTPUT_BUFFER_PLANE.
- Remove Log message.
Change-Id: Ia85646964b4167d7c6c36c1da78eaa981e7fb323
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pH264Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[2] = {0, 0};
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
bufferConf.eCompressionFormat = VIDEO_CODING_AVC;
pInbufOps->Set_Shareable(hMFCHandle);
if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
- bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2;
+ bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth
+ * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2;
inputBufferNumber = MAX_VIDEO_INPUTBUFFER_NUM;
} else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE;
plane.addr = pVideoDec->pMFCDecInputBuffer[i]->VirAddr;
plane.allocSize = pVideoDec->pMFCDecInputBuffer[i]->bufferSize;
plane.fd = 0;
- if (pInbufOps->Register(hMFCHandle, &plane, 1) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer;
plane.allocSize = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->nAllocLen;
plane.fd = pExynosInputPort->extendBufferHeader[i].buf_fd[0];
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE,
- "%s: registering buf %d (hdr=%p) (addr=%p alloc_sz=%ld fd=%d)\n", __func__,
- i, &pExynosInputPort->extendBufferHeader[i], plane.addr, plane.allocSize,
- plane.fd);
-
- if (pInbufOps->Register(hMFCHandle, &plane, 1) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
/* input buffer enqueue for header parsing */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d", oneFrameSize);
- if (pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, (unsigned int *)&oneFrameSize, 1, pSrcInputData->bufferHeader) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
+ (unsigned int *)&oneFrameSize, MFC_INPUT_BUFFER_PLANE, pSrcInputData->bufferHeader) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to enqueue input buffer for header parsing");
// ret = OMX_ErrorInsufficientResources;
ret = (OMX_ERRORTYPE)OMX_ErrorCodecInit;
int YBufferSize = calc_plane(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth, pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight);
int CBufferSize = calc_plane(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth, pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight >> 1);
- OMX_U32 dataLen[2] = {0, 0};
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: using copy buf\n", __func__);
/* Register output buffer */
for (i = 0; i < nOutbufs; i++) {
- ExynosVideoPlane planes[2];
+ ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
int plane;
pVideoDec->pMFCDecOutputBuffer[i] = (CODEC_DEC_OUTPUT_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_DEC_OUTPUT_BUFFER));
goto EXIT;
}
- for (plane = 0; plane < 2; plane++) {
+ for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) {
planes[plane].addr = pVideoDec->pMFCDecOutputBuffer[i]->VirAddr[plane];
planes[plane].allocSize = pVideoDec->pMFCDecOutputBuffer[i]->bufferSize[plane];
planes[plane].fd = pVideoDec->pMFCDecOutputBuffer[i]->fd[plane];
}
- if (pOutbufOps->Register(hMFCHandle, planes, 2) != VIDEO_ERROR_NONE) {
+ if (pOutbufOps->Register(hMFCHandle, planes, MFC_OUTPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register output buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
}
- pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->VirAddr, (unsigned int *)dataLen, 2, NULL);
+ pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->VirAddr,
+ (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
}
} else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) {
/* Register output buffer */
// OMX_U32 stride;
for (i = 0; i < pExynosOutputPort->assignedBufferNum; i++) {
EXYNOS_OMX_BUFFERHEADERTYPE *buffer = &pExynosOutputPort->extendBufferHeader[i];
- ExynosVideoPlane planes[2];
+ ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
/* luma */
planes[0].addr = buffer->pYUVBuf[0];
// Exynos_OSAL_LockANB(pExynosOutputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer, width, height,
// pExynosOutputPort->portDefinition.format.video.eColorFormat,
// &stride, pExynosOutputPort->extendBufferHeader[i].pYUVBuf);
- if (pOutbufOps->Register(hMFCHandle, planes, 2) != VIDEO_ERROR_NONE) {
- Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
+ if (pOutbufOps->Register(hMFCHandle, planes, MFC_OUTPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register output buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
}
- pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, 2, NULL);
+ pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
// Exynos_OSAL_UnlockANB(pExynosOutputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
}
}
/* queue work for input buffer */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d, bufferHeader: 0x%x, dataBuffer: 0x%x", oneFrameSize, pSrcInputData->bufferHeader, pSrcInputData->buffer.singlePlaneBuffer.dataBuffer);
- codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, (unsigned int *)&oneFrameSize, 1, pSrcInputData->bufferHeader);
+ codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
+ (unsigned int *)&oneFrameSize, MFC_INPUT_BUFFER_PLANE, pSrcInputData->bufferHeader);
if (codecReturn != VIDEO_ERROR_NONE) {
ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
- OMX_U32 dataLen = 0;
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
FunctionIn();
}
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s : %d => ADDR: 0x%x", __FUNCTION__, __LINE__, pDstInputData->buffer.multiPlaneBuffer.dataBuffer[0]);
- codecReturn = pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pDstInputData->buffer.multiPlaneBuffer.dataBuffer, (unsigned int *)&dataLen, 2, pDstInputData->bufferHeader);
+ codecReturn = pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pDstInputData->buffer.multiPlaneBuffer.dataBuffer,
+ (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, pDstInputData->bufferHeader);
+
if (codecReturn != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
- EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
+ EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pMpeg4Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[2] = {0, 0};
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
pInbufOps->Set_Shareable(hMFCHandle);
if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
- bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2;
+ bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth
+ * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2;
inputBufferNumber = MAX_VIDEO_INPUTBUFFER_NUM;
} else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE;
plane.addr = pVideoDec->pMFCDecInputBuffer[i]->VirAddr;
plane.allocSize = pVideoDec->pMFCDecInputBuffer[i]->bufferSize;
plane.fd = 0;
- if (pInbufOps->Register(hMFCHandle, &plane, 1) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer;
plane.allocSize = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->nAllocLen;
plane.fd = pExynosInputPort->extendBufferHeader[i].buf_fd[0];
-
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE,
- "%s: registering buf %d (hdr=%p) (addr=%p alloc_sz=%ld fd=%d)\n", __func__,
- i, &pExynosInputPort->extendBufferHeader[i], plane.addr, plane.allocSize,
- plane.fd);
- if (pInbufOps->Register(hMFCHandle, &plane, 1) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
/* input buffer enqueue for header parsing */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d", oneFrameSize);
- if (pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, (unsigned int *)&oneFrameSize, 1, pSrcInputData->bufferHeader) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
+ (unsigned int *)&oneFrameSize, MFC_INPUT_BUFFER_PLANE, pSrcInputData->bufferHeader) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to enqueue input buffer for header parsing");
// ret = OMX_ErrorInsufficientResources;
ret = (OMX_ERRORTYPE)OMX_ErrorCodecInit;
int YBufferSize = calc_plane(pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth, pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight);
int CBufferSize = calc_plane(pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameWidth, pMpeg4Dec->hMFCMpeg4Handle.codecOutbufConf.nFrameHeight >> 1);
- OMX_U32 dataLen[2] = {0, 0};
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
/* Register output buffer */
for (i = 0; i < nOutbufs; i++) {
- ExynosVideoPlane planes[2];
+ ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
int plane;
pVideoDec->pMFCDecOutputBuffer[i] = (CODEC_DEC_OUTPUT_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_DEC_OUTPUT_BUFFER));
goto EXIT;
}
- for (plane = 0; plane < 2; plane++) {
+ for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) {
planes[plane].addr = pVideoDec->pMFCDecOutputBuffer[i]->VirAddr[plane];
planes[plane].allocSize = pVideoDec->pMFCDecOutputBuffer[i]->bufferSize[plane];
planes[plane].fd = pVideoDec->pMFCDecOutputBuffer[i]->fd[plane];
}
- if (pOutbufOps->Register(hMFCHandle, planes, 2) != VIDEO_ERROR_NONE) {
+ if (pOutbufOps->Register(hMFCHandle, planes, MFC_OUTPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register output buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
}
- pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->VirAddr, (unsigned int *)dataLen, 2, NULL);
+ pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->VirAddr,
+ (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
}
} else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) {
/* Register output buffer */
// OMX_U32 stride;
for (i = 0; i < pExynosOutputPort->assignedBufferNum; i++) {
EXYNOS_OMX_BUFFERHEADERTYPE *buffer = &pExynosOutputPort->extendBufferHeader[i];
- ExynosVideoPlane planes[2];
+ ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
/* luma */
planes[0].addr = buffer->pYUVBuf[0];
// Exynos_OSAL_LockANB(pExynosOutputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer, width, height,
// pExynosOutputPort->portDefinition.format.video.eColorFormat,
// &stride, pExynosOutputPort->extendBufferHeader[i].pYUVBuf);
- if (pOutbufOps->Register(hMFCHandle, planes, 2) != VIDEO_ERROR_NONE) {
- Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
+ if (pOutbufOps->Register(hMFCHandle, planes, MFC_OUTPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register output buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
}
- pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, 2, NULL);
+ pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
// Exynos_OSAL_UnlockANB(pExynosOutputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
}
}
/* queue work for input buffer */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d, bufferHeader: 0x%x, dataBuffer: 0x%x", oneFrameSize, pSrcInputData->bufferHeader, pSrcInputData->buffer.singlePlaneBuffer.dataBuffer);
- codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, (unsigned int *)&oneFrameSize, 1, pSrcInputData->bufferHeader);
+ codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
+ (unsigned int *)&oneFrameSize, MFC_INPUT_BUFFER_PLANE, pSrcInputData->bufferHeader);
if (codecReturn != VIDEO_ERROR_NONE) {
ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
- OMX_U32 dataLen = 0;
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
FunctionIn();
goto EXIT;
}
- codecReturn = pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pDstInputData->buffer.multiPlaneBuffer.dataBuffer, (unsigned int *)&dataLen, 2, pDstInputData->bufferHeader);
+ codecReturn = pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pDstInputData->buffer.multiPlaneBuffer.dataBuffer,
+ (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, pDstInputData->bufferHeader);
+
if (codecReturn != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pVp8Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[2] = {0, 0};
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
bufferConf.eCompressionFormat = VIDEO_CODING_VP8;
pInbufOps->Set_Shareable(hMFCHandle);
if (pExynosInputPort->bufferProcessType == BUFFER_SHARE) {
- bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2;
+ bufferConf.nSizeImage = pExynosInputPort->portDefinition.format.video.nFrameWidth
+ * pExynosInputPort->portDefinition.format.video.nFrameHeight * 3 / 2;
inputBufferNumber = MAX_VIDEO_INPUTBUFFER_NUM;
} else if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
bufferConf.nSizeImage = DEFAULT_MFC_INPUT_BUFFER_SIZE;
plane.addr = pVideoDec->pMFCDecInputBuffer[i]->VirAddr;
plane.allocSize = pVideoDec->pMFCDecInputBuffer[i]->bufferSize;
plane.fd = 0;
- if (pInbufOps->Register(hMFCHandle, &plane, 1) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer;
plane.allocSize = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->nAllocLen;
plane.fd = pExynosInputPort->extendBufferHeader[i].buf_fd[0];
-
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE,
- "%s: registering buf %d (hdr=%p) (addr=%p alloc_sz=%ld fd=%d)\n", __func__,
- i, &pExynosInputPort->extendBufferHeader[i], plane.addr, plane.allocSize,
- plane.fd);
- if (pInbufOps->Register(hMFCHandle, &plane, 1) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
/* input buffer enqueue for header parsing */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d", oneFrameSize);
- if (pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, (unsigned int *)&oneFrameSize, 1, pSrcInputData->bufferHeader) != VIDEO_ERROR_NONE) {
+ if (pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
+ (unsigned int *)&oneFrameSize, MFC_INPUT_BUFFER_PLANE, pSrcInputData->bufferHeader) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to enqueue input buffer for header parsing");
// ret = OMX_ErrorInsufficientResources;
ret = (OMX_ERRORTYPE)OMX_ErrorCodecInit;
int YBufferSize = calc_plane(pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth, pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight);
int CBufferSize = calc_plane(pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth, pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight >> 1);
- OMX_U32 dataLen[2] = {0, 0};
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
/* Register output buffer */
for (i = 0; i < nOutbufs; i++) {
- ExynosVideoPlane planes[2];
+ ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
int plane;
pVideoDec->pMFCDecOutputBuffer[i] = (CODEC_DEC_OUTPUT_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_DEC_OUTPUT_BUFFER));
goto EXIT;
}
- for (plane = 0; plane < 2; plane++) {
+ for (plane = 0; plane < MFC_OUTPUT_BUFFER_PLANE; plane++) {
planes[plane].addr = pVideoDec->pMFCDecOutputBuffer[i]->VirAddr[plane];
planes[plane].allocSize = pVideoDec->pMFCDecOutputBuffer[i]->bufferSize[plane];
planes[plane].fd = pVideoDec->pMFCDecOutputBuffer[i]->fd[plane];
}
- if (pOutbufOps->Register(hMFCHandle, planes, 2) != VIDEO_ERROR_NONE) {
+ if (pOutbufOps->Register(hMFCHandle, planes, MFC_OUTPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register output buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
}
- pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->VirAddr, (unsigned int *)dataLen, 2, NULL);
+ pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->VirAddr,
+ (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
}
} else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) {
/* Register output buffer */
// OMX_U32 stride;
for (i = 0; i < pExynosOutputPort->assignedBufferNum; i++) {
EXYNOS_OMX_BUFFERHEADERTYPE *buffer = &pExynosOutputPort->extendBufferHeader[i];
- ExynosVideoPlane planes[2];
+ ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE];
/* luma */
planes[0].addr = buffer->pYUVBuf[0];
// Exynos_OSAL_LockANB(pExynosOutputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer, width, height,
// pExynosOutputPort->portDefinition.format.video.eColorFormat,
// &stride, pExynosOutputPort->extendBufferHeader[i].pYUVBuf);
- if (pOutbufOps->Register(hMFCHandle, planes, 2) != VIDEO_ERROR_NONE) {
- Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register input buffer");
+ if (pOutbufOps->Register(hMFCHandle, planes, MFC_OUTPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Register output buffer");
ret = OMX_ErrorInsufficientResources;
goto EXIT;
}
- pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, 2, NULL);
+ pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL);
// Exynos_OSAL_UnlockANB(pExynosOutputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
}
}
/* queue work for input buffer */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "oneFrameSize: %d, bufferHeader: 0x%x, dataBuffer: 0x%x", oneFrameSize, pSrcInputData->bufferHeader, pSrcInputData->buffer.singlePlaneBuffer.dataBuffer);
- codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, (unsigned int *)&oneFrameSize, 1, pSrcInputData->bufferHeader);
+ codecReturn = pInbufOps->Enqueue(hMFCHandle, (unsigned char **)&pSrcInputData->buffer.singlePlaneBuffer.dataBuffer,
+ (unsigned int *)&oneFrameSize, MFC_INPUT_BUFFER_PLANE, pSrcInputData->bufferHeader);
if (codecReturn != VIDEO_ERROR_NONE) {
ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
}
pVideoDec->pMFCDecInputBuffer[i]->dataSize = 0;
pSrcOutputData->pPrivate = pVideoDec->pMFCDecInputBuffer[i];
-
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "i: %d, out dataBuffer: 0x%x", i, pSrcOutputData->buffer.singlePlaneBuffer.dataBuffer);
}
/* For Share Buffer */
void *hMFCHandle = pVp8Dec->hMFCVp8Handle.hMFCHandle;
ExynosVideoDecOps *pDecOps = pVp8Dec->hMFCVp8Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pVp8Dec->hMFCVp8Handle.pOutbufOps;
- OMX_U32 dataLen = 0;
+ OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
FunctionIn();
goto EXIT;
}
- codecReturn = pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pDstInputData->buffer.multiPlaneBuffer.dataBuffer, (unsigned int *)&dataLen, 2, pDstInputData->bufferHeader);
+ codecReturn = pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pDstInputData->buffer.multiPlaneBuffer.dataBuffer,
+ (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, pDstInputData->bufferHeader);
+
if (codecReturn != VIDEO_ERROR_NONE) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__);
ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;