From 98034ac0cb4a0f1488dec73efc8f266fc752ecb8 Mon Sep 17 00:00:00 2001 From: SeungBeom Kim Date: Tue, 19 Feb 2013 13:56:51 +0900 Subject: [PATCH] openmax: Change DPB setting scheme. Change DPB setting scheme on buffer shared mode for init and buffer reconfigure. In the case of DPB buffer setting to MFC FW before incomming buffer to OpenMAX component, Need for the Improved stability of buffer processing. Depends On - Change-Id: If008de62a40baa262085fcf9dbadfe4b80ac2619 Change-Id: Iae6843dfc23708f4b80faa1fceeeccef09148482 Signed-off-by: SeungBeom Kim --- component/video/dec/h264/Exynos_OMX_H264dec.c | 21 +++++++++++-------- .../video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c | 21 +++++++++++-------- .../video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 21 +++++++++++-------- component/video/dec/vc1/Exynos_OMX_Wmvdec.c | 21 +++++++++++-------- component/video/dec/vp8/Exynos_OMX_Vp8dec.c | 21 +++++++++++-------- 5 files changed, 60 insertions(+), 45 deletions(-) diff --git a/component/video/dec/h264/Exynos_OMX_H264dec.c b/component/video/dec/h264/Exynos_OMX_H264dec.c index 5269d4c..f7a0d45 100644 --- a/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -1064,6 +1064,12 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE]; int plane; @@ -1097,6 +1103,12 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer"); + ret = OMX_ErrorHardware; + goto EXIT; + } } else { ret = OMX_ErrorNotImplemented; goto EXIT; @@ -1107,15 +1119,6 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) #endif } - if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); - ret = OMX_ErrorInsufficientResources; - goto EXIT; - } - - if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { - H264CodecStop(pOMXComponent, OUTPUT_PORT_INDEX); - } pH264Dec->hMFCH264Handle.bConfiguredMFCDst = OMX_TRUE; ret = OMX_ErrorNone; diff --git a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index 3bd76e9..7d12fa3 100644 --- a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -782,6 +782,12 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE]; int plane; @@ -815,6 +821,12 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer"); + ret = OMX_ErrorHardware; + goto EXIT; + } } else { ret = OMX_ErrorNotImplemented; goto EXIT; @@ -825,15 +837,6 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) #endif } - if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); - ret = OMX_ErrorInsufficientResources; - goto EXIT; - } - - if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { - Mpeg2CodecStop (pOMXComponent, OUTPUT_PORT_INDEX); - } pMpeg2Dec->hMFCMpeg2Handle.bConfiguredMFCDst = OMX_TRUE; ret = OMX_ErrorNone; diff --git a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 680d49f..3ef67f7 100644 --- a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -1003,6 +1003,12 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE]; int plane; @@ -1036,6 +1042,12 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer"); + ret = OMX_ErrorHardware; + goto EXIT; + } } else { ret = OMX_ErrorNotImplemented; goto EXIT; @@ -1046,15 +1058,6 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) #endif } - if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); - ret = OMX_ErrorInsufficientResources; - goto EXIT; - } - - if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { - Mpeg4CodecStop(pOMXComponent, OUTPUT_PORT_INDEX); - } pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCDst = OMX_TRUE; ret = OMX_ErrorNone; diff --git a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index a0b31d9..4bd3854 100644 --- a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -1046,6 +1046,12 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE]; int plane; @@ -1079,6 +1085,12 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer"); + ret = OMX_ErrorHardware; + goto EXIT; + } } else { ret = OMX_ErrorNotImplemented; goto EXIT; @@ -1089,15 +1101,6 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) #endif } - if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); - ret = OMX_ErrorInsufficientResources; - goto EXIT; - } - - if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { - WmvCodecStop (pOMXComponent, OUTPUT_PORT_INDEX); - } pWmvDec->hMFCWmvHandle.bConfiguredMFCDst = OMX_TRUE; ret = OMX_ErrorNone; diff --git a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index c1af2c7..2e56a61 100644 --- a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -814,6 +814,12 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pVideoDec->pMFCDecOutputBuffer[i]->pVirAddr, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } } else if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { ExynosVideoPlane planes[MFC_OUTPUT_BUFFER_PLANE]; int plane; @@ -847,6 +853,12 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) pOutbufOps->Enqueue(hMFCHandle, (unsigned char **)pExynosOutputPort->extendBufferHeader[i].pYUVBuf, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, NULL); } + + if (pOutbufOps->Apply_RegisteredBuffer(hMFCHandle) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Apply output buffer"); + ret = OMX_ErrorHardware; + goto EXIT; + } } else { ret = OMX_ErrorNotImplemented; goto EXIT; @@ -857,15 +869,6 @@ OMX_ERRORTYPE VP8CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent) #endif } - if (pOutbufOps->Run(hMFCHandle) != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to run output buffer"); - ret = OMX_ErrorInsufficientResources; - goto EXIT; - } - - if (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) { - VP8CodecStop (pOMXComponent, OUTPUT_PORT_INDEX); - } pVp8Dec->hMFCVp8Handle.bConfiguredMFCDst = OMX_TRUE; ret = OMX_ErrorNone; -- 2.20.1