return ret;
}
-OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData)
+OMX_ERRORTYPE Exynos_Output_CodecBufferToData(
+ CODEC_DEC_BUFFER *pCodecBuffer,
+ EXYNOS_OMX_DATA *pData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
- OMX_PTR pSrcBuf[MAX_BUFFER_PLANE];
- OMX_U32 allocSize[MAX_BUFFER_PLANE];
-
- pVideoDec->exynos_codec_getCodecOutputPrivateData(codecBuffer, pSrcBuf, allocSize);
- pData->buffer.multiPlaneBuffer.dataBuffer[0] = pSrcBuf[0];
- pData->buffer.multiPlaneBuffer.dataBuffer[1] = pSrcBuf[1];
- pData->buffer.multiPlaneBuffer.dataBuffer[2] = pSrcBuf[2];
- pData->allocSize = allocSize[0] + allocSize[1] + allocSize[2];
+
+ 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->allocSize = pCodecBuffer->bufferSize[0] + pCodecBuffer->bufferSize[1] + pCodecBuffer->bufferSize[2];
pData->dataLen = 0;
pData->usedDataLen = 0;
pData->remainDataLen = 0;
pData->nFlags = 0;
pData->timeStamp = 0;
- pData->pPrivate = codecBuffer;
+ pData->pPrivate = pCodecBuffer;
pData->bufferHeader = NULL;
return ret;
Exynos_OSAL_MutexLock(dstInputUseBuffer->bufferMutex);
if (ret != OMX_ErrorOutputBufferUseYet) {
if (exynosOutputPort->bufferProcessType & BUFFER_COPY) {
- OMX_PTR codecBuffer;
- ret = Exynos_CodecBufferDeQueue(pExynosComponent, OUTPUT_PORT_INDEX, &codecBuffer);
+ CODEC_DEC_BUFFER *pCodecBuffer = NULL;
+ ret = Exynos_CodecBufferDeQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR *)&pCodecBuffer);
if (ret != OMX_ErrorNone) {
Exynos_OSAL_MutexUnlock(dstInputUseBuffer->bufferMutex);
break;
}
- Exynos_Output_CodecBufferToData(pExynosComponent, codecBuffer, &dstInputData);
+ Exynos_Output_CodecBufferToData(pCodecBuffer, &dstInputData);
}
if (exynosOutputPort->bufferProcessType & BUFFER_SHARE) {
}
if (exynosOutputPort->bufferProcessType & BUFFER_COPY) {
- OMX_PTR codecBuffer;
- codecBuffer = pDstOutputData->pPrivate;
- if (codecBuffer != NULL) {
- Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, codecBuffer);
+ if (pDstOutputData->pPrivate != NULL) {
+ Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, pDstOutputData->pPrivate);
pDstOutputData->pPrivate = NULL;
}
}
inline void Exynos_UpdateFrameSize(OMX_COMPONENTTYPE *pOMXComponent);
OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex);
OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData);
-OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData);
+OMX_ERRORTYPE Exynos_Output_CodecBufferToData(CODEC_DEC_BUFFER *pCodecBuffer, EXYNOS_OMX_DATA *pData);
OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent);
OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent);
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pH264Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
- ExynosVideoBuffer *pBuffer = NULL;
-
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
- nOutbufs = pDecOps->Get_ActualBufferCount(hMFCHandle);
- nOutbufs += EXTRA_DPB_NUM;
- for (i = 0; i < nOutbufs; i++) {
- pOutbufOps->Get_Buffer(hMFCHandle, i, &pBuffer);
- Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
+ for (i = 0; i < pH264Dec->hMFCH264Handle.maxDPBNum; i++) {
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]->pVirAddr[0]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]);
+
+ Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, pVideoDec->pMFCDecOutputBuffer[i]);
}
pOutbufOps->Clear_Queue(hMFCHandle);
}
}
pDstOutputData->usedDataLen = 0;
pDstOutputData->pPrivate = pVideoBuffer;
+ if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
+ int i = 0;
+ pDstOutputData->pPrivate = NULL;
+ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) {
+ if (pDstOutputData->buffer.multiPlaneBuffer.dataBuffer[0] ==
+ pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]) {
+ pDstOutputData->pPrivate = pVideoDec->pMFCDecOutputBuffer[i];
+ break;
+ }
+ }
+
+ if (pDstOutputData->pPrivate == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer");
+ ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
+ goto EXIT;
+ }
+ }
+
/* For Share Buffer */
pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate;
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pMpeg2Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
- ExynosVideoBuffer *pBuffer = NULL;
-
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
- nOutbufs = pDecOps->Get_ActualBufferCount(hMFCHandle);
- nOutbufs += EXTRA_DPB_NUM;
- for (i = 0; i < nOutbufs; i++) {
- pOutbufOps->Get_Buffer(hMFCHandle, i, &pBuffer);
- Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
+ for (i = 0; i < pMpeg2Dec->hMFCMpeg2Handle.maxDPBNum; i++) {
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]->pVirAddr[0]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]);
+
+ Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, pVideoDec->pMFCDecOutputBuffer[i]);
}
pOutbufOps->Clear_Queue(hMFCHandle);
}
}
pDstOutputData->usedDataLen = 0;
pDstOutputData->pPrivate = pVideoBuffer;
+ if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
+ int i = 0;
+ pDstOutputData->pPrivate = NULL;
+ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) {
+ if (pDstOutputData->buffer.multiPlaneBuffer.dataBuffer[0] ==
+ pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]) {
+ pDstOutputData->pPrivate = pVideoDec->pMFCDecOutputBuffer[i];
+ break;
+ }
+ }
+
+ if (pDstOutputData->pPrivate == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer");
+ ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
+ goto EXIT;
+ }
+ }
+
/* For Share Buffer */
pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate;
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pMpeg4Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
- ExynosVideoBuffer *pBuffer = NULL;
-
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
- nOutbufs = pDecOps->Get_ActualBufferCount(hMFCHandle);
- nOutbufs += EXTRA_DPB_NUM;
- for (i = 0; i < nOutbufs; i++) {
- pOutbufOps->Get_Buffer(hMFCHandle, i, &pBuffer);
- Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
+ for (i = 0; i < pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum; i++) {
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]->pVirAddr[0]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]);
+
+ Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, pVideoDec->pMFCDecOutputBuffer[i]);
}
pOutbufOps->Clear_Queue(hMFCHandle);
}
}
pDstOutputData->usedDataLen = 0;
pDstOutputData->pPrivate = pVideoBuffer;
+ if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
+ int i = 0;
+ pDstOutputData->pPrivate = NULL;
+ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) {
+ if (pDstOutputData->buffer.multiPlaneBuffer.dataBuffer[0] ==
+ pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]) {
+ pDstOutputData->pPrivate = pVideoDec->pMFCDecOutputBuffer[i];
+ break;
+ }
+ }
+
+ if (pDstOutputData->pPrivate == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer");
+ ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
+ goto EXIT;
+ }
+ }
+
/* For Share Buffer */
pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate;
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pWmvDec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
- ExynosVideoBuffer *pBuffer = NULL;
-
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
- nOutbufs = pDecOps->Get_ActualBufferCount(hMFCHandle);
- nOutbufs += EXTRA_DPB_NUM;
- for (i = 0; i < nOutbufs; i++) {
- pOutbufOps->Get_Buffer(hMFCHandle, i, &pBuffer);
- Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
+ for (i = 0; i < pWmvDec->hMFCWmvHandle.maxDPBNum; i++) {
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]->pVirAddr[0]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]);
+
+ Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, pVideoDec->pMFCDecOutputBuffer[i]);
}
pOutbufOps->Clear_Queue(hMFCHandle);
}
}
pDstOutputData->usedDataLen = 0;
pDstOutputData->pPrivate = pVideoBuffer;
+ if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
+ int i = 0;
+ pDstOutputData->pPrivate = NULL;
+ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) {
+ if (pDstOutputData->buffer.multiPlaneBuffer.dataBuffer[0] ==
+ pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]) {
+ pDstOutputData->pPrivate = pVideoDec->pMFCDecOutputBuffer[i];
+ break;
+ }
+ }
+
+ if (pDstOutputData->pPrivate == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer");
+ ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
+ goto EXIT;
+ }
+ }
+
/* For Share Buffer */
pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate;
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pVp8Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
- ExynosVideoBuffer *pBuffer = NULL;
-
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
- nOutbufs = pDecOps->Get_ActualBufferCount(hMFCHandle);
- nOutbufs += EXTRA_DPB_NUM;
- for (i = 0; i < nOutbufs; i++) {
- pOutbufOps->Get_Buffer(hMFCHandle, i, &pBuffer);
- Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer);
+ for (i = 0; i < pVp8Dec->hMFCVp8Handle.maxDPBNum; i++) {
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "pVideoDec->pMFCDecOutputBuffer[%d]->pVirAddr[0]: 0x%x", i, pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]);
+
+ Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, pVideoDec->pMFCDecOutputBuffer[i]);
}
pOutbufOps->Clear_Queue(hMFCHandle);
}
}
pDstOutputData->usedDataLen = 0;
pDstOutputData->pPrivate = pVideoBuffer;
+ if (pExynosOutputPort->bufferProcessType & BUFFER_COPY) {
+ int i = 0;
+ pDstOutputData->pPrivate = NULL;
+ for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) {
+ if (pDstOutputData->buffer.multiPlaneBuffer.dataBuffer[0] ==
+ pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr[0]) {
+ pDstOutputData->pPrivate = pVideoDec->pMFCDecOutputBuffer[i];
+ break;
+ }
+ }
+
+ if (pDstOutputData->pPrivate == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not find buffer");
+ ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode;
+ goto EXIT;
+ }
+ }
+
/* For Share Buffer */
pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate;