openmax: Buffer flag processing scheme change after EOS.
authorSeungBeom Kim <sbcrux.kim@samsung.com>
Wed, 20 Feb 2013 06:47:49 +0000 (15:47 +0900)
committerSeungBeom Kim <sbcrux.kim@samsung.com>
Wed, 20 Feb 2013 06:47:49 +0000 (15:47 +0900)
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 <sbcrux.kim@samsung.com>
component/video/dec/h264/Exynos_OMX_H264dec.c
component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
component/video/dec/vc1/Exynos_OMX_Wmvdec.c
component/video/dec/vp8/Exynos_OMX_Vp8dec.c
include/exynos/Exynos_OMX_Def.h

index f7a0d453a9bfb7f1ee1b0f8b54d6c2d1c82fe4d2..fb4737cc801efb31a828d9d396753314b685e830 100644 (file)
@@ -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;
index 7d12fa361473aa865b9c92577da11936b1e8b722..b29dda5669a8be9d9edf9f53d083f80aa9161ec5 100644 (file)
@@ -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;
index 3ef67f74af10ab23661ffcd1122d5dc9bdac8028..7d91d848734266ed0e79111099f375a415c7cdb0 100644 (file)
@@ -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;
index 4bd3854ca90c2568ad77cb42fa1f96becfa08dd2..59c01f84f07f16cf6c7dffaa891bbde3c54cfc2b 100644 (file)
@@ -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;
index 2e56a61370866df4962c591c2e67faa5208f3843..d51cfaf6fa9a2d5e6bea5eeb0cbd59073fadccd8 100644 (file)
@@ -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;
index a7c61abdd349f33a488d40311e8c54521cd377ff..e3cebf20e94a06a3e3f276b445303b6924e86251 100644 (file)
@@ -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