Exynos_OSAL_Memset(pVideoDec, 0, sizeof(EXYNOS_OMX_VIDEODEC_COMPONENT));
pVideoDec->bReconfigDPB = OMX_FALSE;
pVideoDec->nSavedDPBCnt = 0;
+ pVideoDec->bDTSMode = OMX_FALSE;
pExynosComponent->hComponentHandle = (OMX_HANDLETYPE)pVideoDec;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
{
OMX_HANDLETYPE hCodecHandle;
OMX_BOOL bThumbnailMode;
+ OMX_BOOL bDTSMode; /* true:Decoding Time Stamp, false:Presentation Time Stamp */
OMX_BOOL bFirstFrame;
CODEC_DEC_BUFFER *pMFCDecInputBuffer[MFC_INPUT_BUFFER_NUM_MAX];
CODEC_DEC_BUFFER *pMFCDecOutputBuffer[MFC_OUTPUT_BUFFER_NUM_MAX];
pExynosPort->bNeedContigMem = pPortMemType->bNeedContigMem;
}
break;
+ case OMX_IndexVendorSetDTSMode:
+ {
+ EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
+ EXYNOS_OMX_VIDEO_PARAM_DTSMODE *pDTSParam = (EXYNOS_OMX_VIDEO_PARAM_DTSMODE *)ComponentParameterStructure;
+
+ ret = Exynos_OMX_Check_SizeVersion(pDTSParam, sizeof(EXYNOS_OMX_VIDEO_PARAM_DTSMODE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ pVideoDec->bDTSMode = pDTSParam->bDTSMode;
+ }
+ break;
default:
{
ret = Exynos_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure);
*pIndexType = (OMX_INDEXTYPE) OMX_IndexVendorGetBufferFD;
ret = OMX_ErrorNone;
goto EXIT;
+ } else if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_SET_DTS_MODE) == 0) {
+ *pIndexType = (OMX_INDEXTYPE) OMX_IndexVendorSetDTSMode;
+ ret = OMX_ErrorNone;
+ goto EXIT;
}
#ifdef USE_ANB
if (pVideoDec->bThumbnailMode == OMX_TRUE)
pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if ((pDecOps->Enable_DTSMode != NULL) &&
+ (pVideoDec->bDTSMode == OMX_TRUE))
+ pDecOps->Enable_DTSMode(hMFCHandle);
+
/* input buffer info */
Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf));
bufferConf.eCompressionFormat = VIDEO_CODING_AVC;
} else {
/* For timestamp correction. if mfc support frametype detect */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType);
-#ifdef NEED_TIMESTAMP_REORDER
- if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
- pH264Dec->hMFCH264Handle.outputIndexTimestamp = indexTimestamp;
- } else {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[pH264Dec->hMFCH264Handle.outputIndexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[pH264Dec->hMFCH264Handle.outputIndexTimestamp];
+
+ /* NEED TIMESTAMP REORDER */
+ if (pVideoDec->bDTSMode == OMX_TRUE) {
+ if (pVideoBuffer->frameType == VIDEO_FRAME_I)
+ pH264Dec->hMFCH264Handle.outputIndexTimestamp = indexTimestamp;
+ else
+ indexTimestamp = pH264Dec->hMFCH264Handle.outputIndexTimestamp;
}
-#else
+
pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
-#endif
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "timestamp %lld us (%.2f secs), indexTimestamp: %d, nFlags: 0x%x", pDstOutputData->timeStamp, pDstOutputData->timeStamp / 1E6, indexTimestamp, pDstOutputData->nFlags);
}
if (pVideoDec->bThumbnailMode == OMX_TRUE)
pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if ((pDecOps->Enable_DTSMode != NULL) &&
+ (pVideoDec->bDTSMode == OMX_TRUE))
+ pDecOps->Enable_DTSMode(hMFCHandle);
+
/* input buffer info */
Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf));
bufferConf.eCompressionFormat = VIDEO_CODING_MPEG2;
} else {
/* For timestamp correction. if mfc support frametype detect */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType);
-#ifdef NEED_TIMESTAMP_REORDER
- if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
- pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp = indexTimestamp;
- } else {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp];
+
+ /* NEED TIMESTAMP REORDER */
+ if (pVideoDec->bDTSMode == OMX_TRUE) {
+ if (pVideoBuffer->frameType == VIDEO_FRAME_I)
+ pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp = indexTimestamp;
+ else
+ indexTimestamp = pMpeg2Dec->hMFCMpeg2Handle.outputIndexTimestamp;
}
-#else
+
pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
-#endif
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "timestamp %lld us (%.2f secs), indexTimestamp: %d, nFlags: 0x%x", pDstOutputData->timeStamp, pDstOutputData->timeStamp / 1E6, indexTimestamp, pDstOutputData->nFlags);
}
if (pVideoDec->bThumbnailMode == OMX_TRUE)
pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if ((pDecOps->Enable_DTSMode != NULL) &&
+ (pVideoDec->bDTSMode == OMX_TRUE))
+ pDecOps->Enable_DTSMode(hMFCHandle);
+
/* input buffer info */
Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf));
if (pMpeg4Dec->hMFCMpeg4Handle.codecType == CODEC_TYPE_MPEG4)
} else {
/* For timestamp correction. if mfc support frametype detect */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType);
-#ifdef NEED_TIMESTAMP_REORDER
- if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
- pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp = indexTimestamp;
- } else {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp];
+
+ /* NEED TIMESTAMP REORDER */
+ if (pVideoDec->bDTSMode == OMX_TRUE) {
+ if (pVideoBuffer->frameType == VIDEO_FRAME_I)
+ pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp = indexTimestamp;
+ else
+ indexTimestamp = pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp;
}
-#else
+
pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
-#endif
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "timestamp %lld us (%.2f secs), indexTimestamp: %d, nFlags: 0x%x", pDstOutputData->timeStamp, pDstOutputData->timeStamp / 1E6, indexTimestamp, pDstOutputData->nFlags);
}
if (pVideoDec->bThumbnailMode == OMX_TRUE)
pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if ((pDecOps->Enable_DTSMode != NULL) &&
+ (pVideoDec->bDTSMode == OMX_TRUE))
+ pDecOps->Enable_DTSMode(hMFCHandle);
+
if (pSrcInputData->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
BitmapInfoHhr *pBitmapInfoHeader;
pBitmapInfoHeader = (BitmapInfoHhr *)pSrcInputData->buffer.singlePlaneBuffer.dataBuffer;
} else {
/* For timestamp correction. if mfc support frametype detect */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType);
-#ifdef NEED_TIMESTAMP_REORDER
- if ((pVideoBuffer->frameType == VIDEO_FRAME_I) ||
- ((pVideoBuffer->frameType == VIDEO_FRAME_OTHERS) &&
- ((pExynosComponent->nFlags[indexTimestamp] & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS))) {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
- pWmvDec->hMFCWmvHandle.outputIndexTimestamp = indexTimestamp;
- } else {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[pWmvDec->hMFCWmvHandle.outputIndexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[pWmvDec->hMFCWmvHandle.outputIndexTimestamp];
+
+ /* NEED TIMESTAMP REORDER */
+ if (pVideoDec->bDTSMode == OMX_TRUE) {
+ if ((pVideoBuffer->frameType == VIDEO_FRAME_I) ||
+ ((pVideoBuffer->frameType == VIDEO_FRAME_OTHERS) &&
+ ((pExynosComponent->nFlags[indexTimestamp] & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)))
+ pWmvDec->hMFCWmvHandle.outputIndexTimestamp = indexTimestamp;
+ else
+ indexTimestamp = pWmvDec->hMFCWmvHandle.outputIndexTimestamp;
}
-#else
+
pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
-#endif
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "timestamp %lld us (%.2f secs), indexTimestamp: %d, nFlags: 0x%x", pDstOutputData->timeStamp, pDstOutputData->timeStamp / 1E6, indexTimestamp, pDstOutputData->nFlags);
}
if (pVideoDec->bThumbnailMode == OMX_TRUE)
pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if ((pDecOps->Enable_DTSMode != NULL) &&
+ (pVideoDec->bDTSMode == OMX_TRUE))
+ pDecOps->Enable_DTSMode(hMFCHandle);
+
/* input buffer info */
Exynos_OSAL_Memset(&bufferConf, 0, sizeof(bufferConf));
bufferConf.eCompressionFormat = VIDEO_CODING_VP8;
} else {
/* For timestamp correction. if mfc support frametype detect */
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "disp_pic_frame_type: %d", pVideoBuffer->frameType);
-#ifdef NEED_TIMESTAMP_REORDER
- if ((pVideoBuffer->frameType == VIDEO_FRAME_I)) {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
- pVp8Dec->hMFCVp8Handle.outputIndexTimestamp = indexTimestamp;
- } else {
- pDstOutputData->timeStamp = pExynosComponent->timeStamp[pVp8Dec->hMFCVp8Handle.outputIndexTimestamp];
- pDstOutputData->nFlags = pExynosComponent->nFlags[pVp8Dec->hMFCVp8Handle.outputIndexTimestamp];
+
+ /* NEED TIMESTAMP REORDER */
+ if (pVideoDec->bDTSMode == OMX_TRUE) {
+ if (pVideoBuffer->frameType == VIDEO_FRAME_I)
+ pVp8Dec->hMFCVp8Handle.outputIndexTimestamp = indexTimestamp;
+ else
+ indexTimestamp = pVp8Dec->hMFCVp8Handle.outputIndexTimestamp;
}
-#else
+
pDstOutputData->timeStamp = pExynosComponent->timeStamp[indexTimestamp];
pDstOutputData->nFlags = pExynosComponent->nFlags[indexTimestamp];
-#endif
+
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "timestamp %lld us (%.2f secs), indexTimestamp: %d, nFlags: 0x%x", pDstOutputData->timeStamp, pDstOutputData->timeStamp / 1E6, indexTimestamp, pDstOutputData->nFlags);
}
OMX_BOOL bNeedContigMem;
} EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE;
+typedef struct _EXYNOS_OMX_VIDEO_PARAM_DTSMODE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bDTSMode;
+} EXYNOS_OMX_VIDEO_PARAM_DTSMODE;
+
typedef struct _EXYNOS_OMX_VIDEO_CONFIG_BUFFERINFO {
OMX_U32 nSize;
OMX_VERSIONTYPE nVersion;
OMX_IndexVendorNeedContigMemory = 0x7F000004,
#define EXYNOS_INDEX_CONFIG_GET_BUFFER_FD "OMX.SEC.index.GetBufferFD"
OMX_IndexVendorGetBufferFD = 0x7F000005,
+#define EXYNOS_INDEX_PARAM_SET_DTS_MODE "OMX.SEC.index.SetDTSMode"
+ OMX_IndexVendorSetDTSMode = 0x7F000006,
/* for Android Native Window */
#define EXYNOS_INDEX_PARAM_ENABLE_ANB "OMX.google.android.index.enableAndroidNativeBuffers"