Google has updated CTS test.
Support EOSBehavior for testEOSBehaviorH263 & testEOSBehaviorH264.
In case of "EOS Flag with Data",
This Patch is support for normal processing.
Depends On
- Change I781712a5: libcodec: Support EOSBehavior.
Change-Id: I560434c55dd4932f018f973e0093453f493409cb
Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
OMX_BOOL reInputData;
OMX_BOOL bUseFlagEOF;
- OMX_BOOL bSaveFlagEOS;
+ OMX_BOOL bSaveFlagEOS; /* bSaveFlagEOS is OMX_TRUE, if EOS flag is incoming. */
+ OMX_BOOL bBehaviorEOS; /* bBehaviorEOS is OMX_TRUE, if EOS flag with Data are incoming. */
/* Check for Old & New OMX Process type switch */
OMX_BOOL bMultiThreadProcess;
return ret;
}
+OMX_ERRORTYPE Exynos_ResetAllPortConfig(OMX_COMPONENTTYPE *pOMXComponent)
+{
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+ EXYNOS_OMX_BASEPORT *pInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
+ EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
+
+ /* Input port */
+ pInputPort->portDefinition.format.video.nFrameWidth = DEFAULT_FRAME_WIDTH;
+ pInputPort->portDefinition.format.video.nFrameHeight = DEFAULT_FRAME_HEIGHT;
+ pInputPort->portDefinition.format.video.nStride = 0; /*DEFAULT_FRAME_WIDTH;*/
+ pInputPort->portDefinition.format.video.nSliceHeight = 0;
+ pInputPort->portDefinition.format.video.pNativeRender = 0;
+ pInputPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE;
+ pInputPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatUnused;
+
+ pInputPort->portDefinition.nBufferSize = DEFAULT_VIDEO_INPUT_BUFFER_SIZE;
+ pInputPort->portDefinition.bEnabled = OMX_TRUE;
+
+ pInputPort->bufferProcessType = BUFFER_SHARE;
+ pInputPort->portWayType = WAY2_PORT;
+
+ /* Output port */
+ pOutputPort->portDefinition.format.video.nFrameWidth = DEFAULT_FRAME_WIDTH;
+ pOutputPort->portDefinition.format.video.nFrameHeight = DEFAULT_FRAME_HEIGHT;
+ pOutputPort->portDefinition.format.video.nStride = 0; /*DEFAULT_FRAME_WIDTH;*/
+ pOutputPort->portDefinition.format.video.nSliceHeight = 0;
+ pOutputPort->portDefinition.format.video.pNativeRender = 0;
+ pOutputPort->portDefinition.format.video.bFlagErrorConcealment = OMX_FALSE;
+ pOutputPort->portDefinition.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar;
+
+ pOutputPort->portDefinition.nBufferSize = DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE;
+ pOutputPort->portDefinition.bEnabled = OMX_TRUE;
+
+ pOutputPort->bufferProcessType = BUFFER_COPY | BUFFER_ANBSHARE;
+ pOutputPort->bIsANBEnabled = OMX_FALSE;
+ pOutputPort->portWayType = WAY2_PORT;
+
+ return ret;
+}
+
OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
if ((srcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "bSaveFlagEOS : OMX_TRUE");
- srcInputData->dataLen = 0;
- srcInputData->remainDataLen = 0;
pExynosComponent->bSaveFlagEOS = OMX_TRUE;
+ if (srcInputData->dataLen != 0)
+ pExynosComponent->bBehaviorEOS = OMX_TRUE;
}
if (pExynosComponent->checkTimeStamp.needSetStartTimeStamp == OMX_TRUE) {
Exynos_OSAL_ThreadTerminate(pVideoDec->hDstOutputThread);
pVideoDec->hDstOutputThread = NULL;
+ pExynosComponent->checkTimeStamp.needSetStartTimeStamp = OMX_FALSE;
+ pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE;
+
EXIT:
FunctionOut();
pExynosComponent->hComponentHandle = (OMX_HANDLETYPE)pVideoDec;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
pExynosComponent->bMultiThreadProcess = OMX_TRUE;
/* Input port */
Exynos_OSAL_Memset(pExynosComponent->nFlags, 0, sizeof(OMX_U32) * MAX_FLAGS);
pExynosComponent->getAllDelayBuffer = OMX_FALSE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
pExynosComponent->reInputData = OMX_FALSE;
}
}
if ((pBufferHdr->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
- pBufferHdr->nFilledLen = 0;
Exynos_OSAL_Log(EXYNOS_LOG_TRACE,"event OMX_BUFFERFLAG_EOS!!!");
pExynosComponent->pCallbacks->EventHandler(pOMXComponent,
pExynosComponent->callbackData,
pExynosPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
portDefinition = &pExynosPort->portDefinition;
- switch (index) {
- case supportFormat_0:
- portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
- portFormat->eColorFormat = OMX_COLOR_FormatYUV420Planar;
- portFormat->xFramerate = portDefinition->format.video.xFramerate;
- break;
- case supportFormat_1:
- portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
- portFormat->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
- portFormat->xFramerate = portDefinition->format.video.xFramerate;
- break;
- case supportFormat_2:
- portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
- portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled;
- portFormat->xFramerate = portDefinition->format.video.xFramerate;
- break;
- default:
- if (index > supportFormat_0) {
- ret = OMX_ErrorNoMore;
- goto EXIT;
+ if (pExynosPort->bIsANBEnabled == OMX_FALSE) {
+ switch (index) {
+ case supportFormat_0:
+ portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
+ portFormat->eColorFormat = OMX_COLOR_FormatYUV420Planar;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ break;
+ case supportFormat_1:
+ portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
+ portFormat->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ break;
+ case supportFormat_2:
+ portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
+ portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ break;
+ default:
+ if (index > supportFormat_0) {
+ ret = OMX_ErrorNoMore;
+ goto EXIT;
+ }
+ break;
+ }
+ } else {
+ switch (index) {
+ case supportFormat_0:
+ portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
+ portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12Tiled;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ break;
+ default:
+ if (index > supportFormat_0) {
+ ret = OMX_ErrorNoMore;
+ goto EXIT;
+ }
+ break;
}
- break;
}
}
ret = OMX_ErrorNone;
pH264Dec->hMFCH264Handle.bConfiguredMFCDst = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
/* H.264 Codec Open */
ret = H264CodecOpen(pH264Dec);
}
H264CodecClose(pH264Dec);
+ Exynos_ResetAllPortConfig(pOMXComponent);
+
EXIT:
FunctionOut();
((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
+
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE)) {
+ pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+ }
} else {
pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
}
pMpeg2Dec->hMFCMpeg2Handle.bConfiguredMFCDst = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
/* Mpeg2 Codec Open */
ret = Mpeg2CodecOpen(pMpeg2Dec);
}
Mpeg2CodecClose(pMpeg2Dec);
+ Exynos_ResetAllPortConfig(pOMXComponent);
+
EXIT:
FunctionOut();
((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
+
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE)) {
+ pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+ }
} else {
pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
}
pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCDst = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
/* Mpeg4 Codec Open */
ret = Mpeg4CodecOpen(pMpeg4Dec);
}
Mpeg4CodecClose(pMpeg4Dec);
+ Exynos_ResetAllPortConfig(pOMXComponent);
+
EXIT:
FunctionOut();
((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
+
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE)) {
+ pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+ }
} else {
pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
}
pWmvDec->hMFCWmvHandle.bConfiguredMFCDst = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
/* WMV Codec Open */
ret = WmvCodecOpen(pWmvDec);
}
WmvCodecClose(pWmvDec);
+ Exynos_ResetAllPortConfig(pOMXComponent);
+
EXIT:
FunctionOut();
((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
+
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE)) {
+ pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+ }
} else {
pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
}
pVp8Dec->hMFCVp8Handle.bConfiguredMFCDst = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
/* VP8 Codec Open */
ret = VP8CodecOpen(pVp8Dec);
}
VP8CodecClose(pVp8Dec);
+ Exynos_ResetAllPortConfig(pOMXComponent);
+
EXIT:
FunctionOut();
((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
+
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE)) {
+ pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+ }
} else {
pDstOutputData->remainDataLen = bufferGeometry->nFrameWidth * bufferGeometry->nFrameHeight * 3 / 2;
}
if ((srcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "bSaveFlagEOS : OMX_TRUE");
- srcInputData->dataLen = 0;
- srcInputData->remainDataLen = 0;
pExynosComponent->bSaveFlagEOS = OMX_TRUE;
+ if (srcInputData->dataLen != 0)
+ pExynosComponent->bBehaviorEOS = OMX_TRUE;
}
if (pExynosComponent->checkTimeStamp.needSetStartTimeStamp == OMX_TRUE) {
Exynos_OSAL_ThreadTerminate(pVideoEnc->hDstOutputThread);
pVideoEnc->hDstOutputThread = NULL;
+ pExynosComponent->checkTimeStamp.needSetStartTimeStamp = OMX_FALSE;
+ pExynosComponent->checkTimeStamp.needCheckStartTimeStamp = OMX_FALSE;
+
EXIT:
FunctionOut();
pExynosComponent->hComponentHandle = (OMX_HANDLETYPE)pVideoEnc;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
pVideoEnc->bFirstInput = OMX_FALSE;
pVideoEnc->bFirstOutput = OMX_FALSE;
Exynos_OSAL_Memset(pExynosComponent->nFlags, 0, sizeof(OMX_U32) * MAX_FLAGS);
pExynosComponent->getAllDelayBuffer = OMX_FALSE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
pExynosComponent->reInputData = OMX_FALSE;
}
}
if ((pBufferHdr->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
- pBufferHdr->nFilledLen = 0;
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "event OMX_BUFFERFLAG_EOS!!!");
pExynosComponent->pCallbacks->EventHandler(pOMXComponent,
pExynosComponent->callbackData,
pVideoEnc->bFirstOutput = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
eColorFormat = pExynosInputPort->portDefinition.format.video.eColorFormat;
if (pExynosInputPort->bStoreMetaData == OMX_TRUE) {
}
if ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) ||
- ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
+ (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_FALSE))) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%x displayStatus:%d, nFlags0x%x", pExynosComponent, displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
}
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE))
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+
ret = OMX_ErrorNone;
EXIT:
pVideoEnc->bFirstOutput = OMX_FALSE;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
pExynosComponent->bSaveFlagEOS = OMX_FALSE;
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
eColorFormat = pExynosInputPort->portDefinition.format.video.eColorFormat;
if (pExynosInputPort->bStoreMetaData == OMX_TRUE) {
}
if ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) ||
- ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
+ (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_FALSE))) {
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%x displayStatus:%d, nFlags0x%x", pExynosComponent, displayStatus, pDstOutputData->nFlags);
pDstOutputData->remainDataLen = 0;
}
+ if (((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) &&
+ (pExynosComponent->bBehaviorEOS == OMX_TRUE))
+ pExynosComponent->bBehaviorEOS = OMX_FALSE;
+
ret = OMX_ErrorNone;
EXIT: