From: SeungBeom Kim Date: Wed, 20 Feb 2013 06:47:49 +0000 (+0900) Subject: openmax: Buffer flag processing scheme change after EOS. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f53da3335f6bdd3de5ce7568deda0ab65ad4582b;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git openmax: Buffer flag processing scheme change after EOS. Add tag INDEX_AFTER_EOS = 0xE05. In the case of after EOS, 1. MFC DD will return INDEX_AFTER_EOS tag. 2. OpenMAX will detect INDEX_AFTER_EOS tag. 3. OpenMAX will return buffer(with timestame = 0x0 and flags = 0x0). < Without patch > Sometimes, OpenMAX will return EOS flag twice when using ACodec. Depends On - Change I57265bc8: MFC: MEDIA: EXYNOS: Change default tag of EOS Change-Id: I5090887eb626fba14d5cba946ff71e3709ec4cfe Signed-off-by: SeungBeom Kim --- diff --git a/component/video/dec/h264/Exynos_OMX_H264dec.c b/component/video/dec/h264/Exynos_OMX_H264dec.c index f7a0d45..fb4737c 100644 --- a/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -2094,9 +2094,14 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX if ((indexTimestamp < 0) || (indexTimestamp >= MAX_TIMESTAMP)) { if ((pExynosComponent->checkTimeStamp.needSetStartTimeStamp != OMX_TRUE) && (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp != OMX_TRUE)) { - pDstOutputData->timeStamp = pExynosComponent->timeStamp[pH264Dec->hMFCH264Handle.outputIndexTimestamp]; - pDstOutputData->nFlags = pExynosComponent->nFlags[pH264Dec->hMFCH264Handle.outputIndexTimestamp]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + if (indexTimestamp == INDEX_AFTER_EOS) { + pDstOutputData->timeStamp = 0x00; + pDstOutputData->nFlags = 0x00; + } else { + pDstOutputData->timeStamp = pExynosComponent->timeStamp[pH264Dec->hMFCH264Handle.outputIndexTimestamp]; + pDstOutputData->nFlags = pExynosComponent->nFlags[pH264Dec->hMFCH264Handle.outputIndexTimestamp]; + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + } } else { pDstOutputData->timeStamp = 0x00; pDstOutputData->nFlags = 0x00; diff --git a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c index 7d12fa3..b29dda5 100644 --- a/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c +++ b/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c @@ -1683,9 +1683,14 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM if ((indexTimestamp < 0) || (indexTimestamp >= MAX_TIMESTAMP)) { if ((pExynosComponent->checkTimeStamp.needSetStartTimeStamp != OMX_TRUE) && (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp != OMX_TRUE)) { - pDstOutputData->timeStamp = pExynosComponent->timeStamp[pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp]; - pDstOutputData->nFlags = pExynosComponent->nFlags[pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + if (indexTimestamp == INDEX_AFTER_EOS) { + pDstOutputData->timeStamp = 0x00; + pDstOutputData->nFlags = 0x00; + } else { + pDstOutputData->timeStamp = pExynosComponent->timeStamp[pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp]; + pDstOutputData->nFlags = pExynosComponent->nFlags[pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp]; + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + } } else { pDstOutputData->timeStamp = 0x00; pDstOutputData->nFlags = 0x00; diff --git a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 3ef67f7..7d91d84 100644 --- a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -2036,9 +2036,14 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM if ((indexTimestamp < 0) || (indexTimestamp >= MAX_TIMESTAMP)) { if ((pExynosComponent->checkTimeStamp.needSetStartTimeStamp != OMX_TRUE) && (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp != OMX_TRUE)) { - pDstOutputData->timeStamp = pExynosComponent->timeStamp[pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp]; - pDstOutputData->nFlags = pExynosComponent->nFlags[pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + if (indexTimestamp == INDEX_AFTER_EOS) { + pDstOutputData->timeStamp = 0x00; + pDstOutputData->nFlags = 0x00; + } else { + pDstOutputData->timeStamp = pExynosComponent->timeStamp[pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp]; + pDstOutputData->nFlags = pExynosComponent->nFlags[pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp]; + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + } } else { pDstOutputData->timeStamp = 0x00; pDstOutputData->nFlags = 0x00; diff --git a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index 4bd3854..59c01f8 100644 --- a/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -1916,9 +1916,14 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ if ((indexTimestamp < 0) || (indexTimestamp >= MAX_TIMESTAMP)) { if ((pExynosComponent->checkTimeStamp.needSetStartTimeStamp != OMX_TRUE) && (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp != OMX_TRUE)) { - pDstOutputData->timeStamp = pExynosComponent->timeStamp[pWmvDec->hMFCWmvHandle.outputIndexTimestamp]; - pDstOutputData->nFlags = pExynosComponent->nFlags[pWmvDec->hMFCWmvHandle.outputIndexTimestamp]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + if (indexTimestamp == INDEX_AFTER_EOS) { + pDstOutputData->timeStamp = 0x00; + pDstOutputData->nFlags = 0x00; + } else { + pDstOutputData->timeStamp = pExynosComponent->timeStamp[pWmvDec->hMFCWmvHandle.outputIndexTimestamp]; + pDstOutputData->nFlags = pExynosComponent->nFlags[pWmvDec->hMFCWmvHandle.outputIndexTimestamp]; + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + } } else { pDstOutputData->timeStamp = 0x00; pDstOutputData->nFlags = 0x00; diff --git a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index 2e56a61..d51cfaf 100644 --- a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -1627,9 +1627,14 @@ OMX_ERRORTYPE Exynos_VP8Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ if ((indexTimestamp < 0) || (indexTimestamp >= MAX_TIMESTAMP)) { if ((pExynosComponent->checkTimeStamp.needSetStartTimeStamp != OMX_TRUE) && (pExynosComponent->checkTimeStamp.needCheckStartTimeStamp != OMX_TRUE)) { - pDstOutputData->timeStamp = pExynosComponent->timeStamp[pVp8Dec->hMFCVp8Handle.outputIndexTimestamp]; - pDstOutputData->nFlags = pExynosComponent->nFlags[pVp8Dec->hMFCVp8Handle.outputIndexTimestamp]; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + if (indexTimestamp == INDEX_AFTER_EOS) { + pDstOutputData->timeStamp = 0x00; + pDstOutputData->nFlags = 0x00; + } else { + pDstOutputData->timeStamp = pExynosComponent->timeStamp[pVp8Dec->hMFCVp8Handle.outputIndexTimestamp]; + pDstOutputData->nFlags = pExynosComponent->nFlags[pVp8Dec->hMFCVp8Handle.outputIndexTimestamp]; + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "missing out indexTimestamp: %d", indexTimestamp); + } } else { pDstOutputData->timeStamp = 0x00; pDstOutputData->nFlags = 0x00; diff --git a/include/exynos/Exynos_OMX_Def.h b/include/exynos/Exynos_OMX_Def.h index a7c61ab..e3cebf2 100644 --- a/include/exynos/Exynos_OMX_Def.h +++ b/include/exynos/Exynos_OMX_Def.h @@ -48,6 +48,8 @@ #define MAX_BUFFER_PLANE 3 +#define INDEX_AFTER_EOS 0xE05 + #define EXYNOS_OMX_INSTALL_PATH "/system/lib/omx/" typedef enum _EXYNOS_CODEC_TYPE