diff options
Diffstat (limited to 'exynos_omx')
11 files changed, 367 insertions, 106 deletions
diff --git a/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c b/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c index 3aaa74f..a456a2b 100644 --- a/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c +++ b/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/dec/src/ExynosVideoDecoder.c @@ -1064,6 +1064,7 @@ EXIT: } free(pCtx->pOutbuf); + pCtx->pOutbuf = NULL; } return ret; @@ -1653,7 +1654,7 @@ static ExynosVideoBuffer *MFC_Decoder_Dequeue_Outbuf(void *pHandle) pthread_mutex_t *pMutex = NULL; struct v4l2_buffer buf; - int value; + int value, state; if (pCtx == NULL) { ALOGE("%s: Video context info must be supplied", __func__); @@ -1702,7 +1703,11 @@ static ExynosVideoBuffer *MFC_Decoder_Dequeue_Outbuf(void *pHandle) pOutbuf->displayStatus = VIDEO_FRAME_STATUS_DISPLAY_ONLY; break; case 3: - pOutbuf->displayStatus = VIDEO_FRAME_STATUS_CHANGE_RESOL; + exynos_v4l2_g_ctrl(pCtx->hDec, V4L2_CID_MPEG_MFC51_VIDEO_CHECK_STATE, &state); + if (state == 1) /* Resolution is changed */ + pOutbuf->displayStatus = VIDEO_FRAME_STATUS_CHANGE_RESOL; + else /* Decoding is finished */ + pOutbuf->displayStatus = VIDEO_FRAME_STATUS_DECODING_FINISHED; break; default: pOutbuf->displayStatus = VIDEO_FRAME_STATUS_UNKNOWN; @@ -1773,6 +1778,96 @@ EXIT: } /* + * [Decoder Buffer OPS] Cleanup Buffer (Input) + */ +static ExynosVideoErrorType MFC_Decoder_Cleanup_Buffer_Inbuf(void *pHandle) +{ + ExynosVideoDecContext *pCtx = (ExynosVideoDecContext *)pHandle; + ExynosVideoErrorType ret = VIDEO_ERROR_NONE; + + struct v4l2_requestbuffers req; + int nBufferCount = 0; + + if (pCtx == NULL) { + ALOGE("%s: Video context info must be supplied", __func__); + ret = VIDEO_ERROR_BADPARAM; + goto EXIT; + } + + nBufferCount = 0; /* for clean-up */ + + memset(&req, 0, sizeof(req)); + + req.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; + req.count = nBufferCount; + + if (pCtx->bShareInbuf == VIDEO_TRUE) + req.memory = pCtx->nMemoryType; + else + req.memory = V4L2_MEMORY_MMAP; + + if (exynos_v4l2_reqbufs(pCtx->hDec, &req) != 0) { + ret = VIDEO_ERROR_APIFAIL; + goto EXIT; + } + + pCtx->nInbufs = (int)req.count; + + if (pCtx->pInbuf != NULL) { + free(pCtx->pInbuf); + pCtx->pInbuf = NULL; + } + +EXIT: + return ret; +} + +/* + * [Decoder Buffer OPS] Cleanup Buffer (Output) + */ +static ExynosVideoErrorType MFC_Decoder_Cleanup_Buffer_Outbuf(void *pHandle) +{ + ExynosVideoDecContext *pCtx = (ExynosVideoDecContext *)pHandle; + ExynosVideoErrorType ret = VIDEO_ERROR_NONE; + + struct v4l2_requestbuffers req; + int nBufferCount = 0; + + if (pCtx == NULL) { + ALOGE("%s: Video context info must be supplied", __func__); + ret = VIDEO_ERROR_BADPARAM; + goto EXIT; + } + + nBufferCount = 0; /* for clean-up */ + + memset(&req, 0, sizeof(req)); + + req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + req.count = nBufferCount; + + if (pCtx->bShareOutbuf == VIDEO_TRUE) + req.memory = pCtx->nMemoryType; + else + req.memory = V4L2_MEMORY_MMAP; + + if (exynos_v4l2_reqbufs(pCtx->hDec, &req) != 0) { + ret = VIDEO_ERROR_APIFAIL; + goto EXIT; + } + + pCtx->nOutbufs = (int)req.count; + + if (pCtx->pOutbuf != NULL) { + free(pCtx->pOutbuf); + pCtx->pOutbuf = NULL; + } + +EXIT: + return ret; +} + +/* * [Decoder Buffer OPS] FindIndex (Output) */ static int MFC_Decoder_FindEmpty_Outbuf(void *pHandle) @@ -1858,7 +1953,7 @@ static ExynosVideoErrorType MFC_Decoder_ExtensionEnqueue_Outbuf( struct v4l2_plane planes[VIDEO_DECODER_OUTBUF_PLANES]; struct v4l2_buffer buf; - int index, i; + int state, index, i; if (pCtx == NULL) { ALOGE("%s: Video context info must be supplied", __func__); @@ -1925,15 +2020,22 @@ static ExynosVideoErrorType MFC_Decoder_ExtensionEnqueue_Outbuf( pthread_mutex_unlock(pMutex); if (exynos_v4l2_qbuf(pCtx->hDec, &buf) != 0) { - ALOGE("%s: Failed to enqueue output buffer", __func__); pthread_mutex_lock(pMutex); pCtx->pOutbuf[buf.index].nIndexUseCnt--; pCtx->pOutbuf[buf.index].pPrivate = NULL; pCtx->pOutbuf[buf.index].bQueued = VIDEO_FALSE; if (pCtx->pOutbuf[buf.index].nIndexUseCnt == 0) pCtx->pOutbuf[buf.index].bSlotUsed = VIDEO_FALSE; + exynos_v4l2_g_ctrl(pCtx->hDec, V4L2_CID_MPEG_MFC51_VIDEO_CHECK_STATE, &state); pthread_mutex_unlock(pMutex); - ret = VIDEO_ERROR_APIFAIL; + + if (state == 1) { + /* The case of Resolution is changed */ + ret = VIDEO_ERROR_WRONGBUFFERSIZE; + } else { + ALOGE("%s: Failed to enqueue output buffer", __func__); + ret = VIDEO_ERROR_APIFAIL; + } goto EXIT; } @@ -1954,7 +2056,7 @@ static ExynosVideoErrorType MFC_Decoder_ExtensionDequeue_Outbuf( ExynosVideoBuffer *pOutbuf = NULL; PrivateDataShareBuffer *pPDSB = NULL; struct v4l2_buffer buf; - int value, i, j; + int value, state, i, j; if (pCtx == NULL) { ALOGE("%s: Video context info must be supplied", __func__); @@ -2000,7 +2102,11 @@ static ExynosVideoErrorType MFC_Decoder_ExtensionDequeue_Outbuf( pOutbuf->displayStatus = VIDEO_FRAME_STATUS_DISPLAY_ONLY; break; case 3: - pOutbuf->displayStatus = VIDEO_FRAME_STATUS_CHANGE_RESOL; + exynos_v4l2_g_ctrl(pCtx->hDec, V4L2_CID_MPEG_MFC51_VIDEO_CHECK_STATE, &state); + if (state == 1) /* Resolution is changed */ + pOutbuf->displayStatus = VIDEO_FRAME_STATUS_CHANGE_RESOL; + else /* Decoding is finished */ + pOutbuf->displayStatus = VIDEO_FRAME_STATUS_DECODING_FINISHED; break; default: pOutbuf->displayStatus = VIDEO_FRAME_STATUS_UNKNOWN; @@ -2106,6 +2212,7 @@ static ExynosVideoDecBufferOps defInbufOps = { .Register = MFC_Decoder_Register_Inbuf, .Clear_RegisteredBuffer = MFC_Decoder_Clear_RegisteredBuffer_Inbuf, .Clear_Queue = MFC_Decoder_Clear_Queued_Inbuf, + .Cleanup_Buffer = MFC_Decoder_Cleanup_Buffer_Inbuf, }; /* @@ -2127,6 +2234,7 @@ static ExynosVideoDecBufferOps defOutbufOps = { .Register = MFC_Decoder_Register_Outbuf, .Clear_RegisteredBuffer = MFC_Decoder_Clear_RegisteredBuffer_Outbuf, .Clear_Queue = MFC_Decoder_Clear_Queued_Outbuf, + .Cleanup_Buffer = MFC_Decoder_Cleanup_Buffer_Outbuf, .ExtensionEnqueue = MFC_Decoder_ExtensionEnqueue_Outbuf, .ExtensionDequeue = MFC_Decoder_ExtensionDequeue_Outbuf, .Enable_DynamicDPB = MFC_Decoder_Enable_DynamicDPB, diff --git a/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include/ExynosVideoApi.h b/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include/ExynosVideoApi.h index 2b9db97..83ae89a 100644 --- a/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include/ExynosVideoApi.h +++ b/exynos_omx/codecs/exynos_codecs/video/exynos5/mfc_v4l2/include/ExynosVideoApi.h @@ -38,6 +38,7 @@ typedef enum _ExynosVideoErrorType { VIDEO_ERROR_MAPFAIL = -5, VIDEO_ERROR_NOBUFFERS = -6, VIDEO_ERROR_POLL = -7, + VIDEO_ERROR_WRONGBUFFERSIZE = -8, } ExynosVideoErrorType; typedef enum _ExynosVideoCodingType { @@ -75,6 +76,7 @@ typedef enum _ExynosVideoFrameStatusType { VIDEO_FRAME_STATUS_DECODING_ONLY, VIDEO_FRAME_STATUS_DISPLAY_DECODING, VIDEO_FRAME_STATUS_DISPLAY_ONLY, + VIDEO_FRAME_STATUS_DECODING_FINISHED, VIDEO_FRAME_STATUS_CHANGE_RESOL, } ExynosVideoFrameStatusType; @@ -284,6 +286,7 @@ typedef struct _ExynosVideoDecBufferOps { ExynosVideoErrorType (*Register)(void *pHandle, ExynosVideoPlane *planes, int nPlanes); ExynosVideoErrorType (*Clear_RegisteredBuffer)(void *pHandle); ExynosVideoErrorType (*Clear_Queue)(void *pHandle); + ExynosVideoErrorType (*Cleanup_Buffer)(void *pHandle); ExynosVideoErrorType (*ExtensionEnqueue)(void *pHandle, unsigned char *pBuffer[], unsigned int *pFd[], unsigned int allocLen[], unsigned int dataSize[], int nPlanes, void *pPrivate); ExynosVideoErrorType (*ExtensionDequeue)(void *pHandle, ExynosVideoBuffer *pVideoBuffer); ExynosVideoErrorType (*Enable_DynamicDPB)(void *pHandle); diff --git a/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Basecomponent.c b/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Basecomponent.c index cbf6a24..75ac8cc 100644 --- a/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Basecomponent.c +++ b/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Basecomponent.c @@ -663,6 +663,22 @@ static OMX_ERRORTYPE Exynos_StateSet(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, } Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "to OMX_StateLoaded"); } else if ((destState == OMX_StateIdle) && (pExynosComponent->currentState == OMX_StateExecuting)) { + EXYNOS_OMX_BASEPORT *pExynosPort = NULL; + + pExynosPort = &(pExynosComponent->pExynosPort[INPUT_PORT_INDEX]); + if ((pExynosPort->portDefinition.bEnabled == OMX_FALSE) && + (pExynosPort->portState == OMX_StateIdle)) { + pExynosPort->exceptionFlag = INVALID_STATE; + Exynos_OSAL_SemaphorePost(pExynosPort->loadedResource); + } + + pExynosPort = &(pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]); + if ((pExynosPort->portDefinition.bEnabled == OMX_FALSE) && + (pExynosPort->portState == OMX_StateIdle)) { + pExynosPort->exceptionFlag = INVALID_STATE; + Exynos_OSAL_SemaphorePost(pExynosPort->loadedResource); + } + pExynosComponent->transientState = EXYNOS_OMX_TransStateExecutingToIdle; Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "to OMX_StateIdle"); } else if ((destState == OMX_StateExecuting) && (pExynosComponent->currentState == OMX_StateIdle)) { diff --git a/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.c b/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.c index f512457..11f34c5 100644 --- a/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.c +++ b/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.c @@ -73,7 +73,7 @@ OMX_ERRORTYPE Exynos_OMX_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, OM OMX_U32 i = 0; Exynos_OSAL_MutexLock(pExynosPort->hPortMutex); - for (i = 0; i < pExynosPort->portDefinition.nBufferCountActual; i++) { + for (i = 0; i < MAX_BUFFER_NUM; i++) { if (bufferHeader == pExynosPort->extendBufferHeader[i].OMXBufferHeader) { pExynosPort->extendBufferHeader[i].bBufferInOMX = OMX_FALSE; break; @@ -83,6 +83,8 @@ OMX_ERRORTYPE Exynos_OMX_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, OM Exynos_OSAL_MutexUnlock(pExynosPort->hPortMutex); pExynosComponent->pCallbacks->FillBufferDone(pOMXComponent, pExynosComponent->callbackData, bufferHeader); +EXIT: + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s : %d, bufferHeader:0x%x", __FUNCTION__, __LINE__, bufferHeader); return ret; } @@ -150,6 +152,11 @@ OMX_ERRORTYPE Exynos_OMX_EnablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 po if ((pExynosComponent->currentState != OMX_StateLoaded) && (pExynosComponent->currentState != OMX_StateWaitForResources)) { Exynos_OSAL_SemaphoreWait(pExynosPort->loadedResource); + + if (pExynosPort->exceptionFlag == INVALID_STATE) { + pExynosPort->exceptionFlag = NEED_PORT_DISABLE; + goto EXIT; + } pExynosPort->portDefinition.bPopulated = OMX_TRUE; } pExynosPort->exceptionFlag = GENERAL_STATE; @@ -377,7 +384,7 @@ OMX_ERRORTYPE Exynos_OMX_EmptyThisBuffer( pExynosPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; if ((!CHECK_PORT_ENABLED(pExynosPort)) || - ((CHECK_PORT_BEING_FLUSHED(pExynosPort) || CHECK_PORT_BEING_DISABLED(pExynosPort)) && + (CHECK_PORT_BEING_FLUSHED(pExynosPort) && (!CHECK_PORT_TUNNELED(pExynosPort) || !CHECK_PORT_BUFFER_SUPPLIER(pExynosPort))) || ((pExynosComponent->transientState == EXYNOS_OMX_TransStateExecutingToIdle) && (CHECK_PORT_TUNNELED(pExynosPort) && !CHECK_PORT_BUFFER_SUPPLIER(pExynosPort)))) { @@ -482,7 +489,7 @@ OMX_ERRORTYPE Exynos_OMX_FillThisBuffer( pExynosPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; if ((!CHECK_PORT_ENABLED(pExynosPort)) || - ((CHECK_PORT_BEING_FLUSHED(pExynosPort) || CHECK_PORT_BEING_DISABLED(pExynosPort)) && + (CHECK_PORT_BEING_FLUSHED(pExynosPort) && (!CHECK_PORT_TUNNELED(pExynosPort) || !CHECK_PORT_BUFFER_SUPPLIER(pExynosPort))) || ((pExynosComponent->transientState == EXYNOS_OMX_TransStateExecutingToIdle) && (CHECK_PORT_TUNNELED(pExynosPort) && !CHECK_PORT_BUFFER_SUPPLIER(pExynosPort)))) { @@ -491,7 +498,7 @@ OMX_ERRORTYPE Exynos_OMX_FillThisBuffer( } Exynos_OSAL_MutexLock(pExynosPort->hPortMutex); - for (i = 0; i < pExynosPort->portDefinition.nBufferCountActual; i++) { + for (i = 0; i < MAX_BUFFER_NUM; i++) { if (pBuffer == pExynosPort->extendBufferHeader[i].OMXBufferHeader) { pExynosPort->extendBufferHeader[i].bBufferInOMX = OMX_TRUE; findBuffer = OMX_TRUE; @@ -652,7 +659,7 @@ OMX_ERRORTYPE Exynos_OMX_Port_Constructor(OMX_HANDLETYPE hComponent) /* Output Port */ pExynosOutputPort = &pExynosPort[OUTPUT_PORT_INDEX]; - Exynos_OSAL_QueueCreate(&pExynosOutputPort->bufferQ, MAX_QUEUE_ELEMENTS); /* For in case of "Output Buffer Share", MAX ELEMENTS(DPB + EDPB) */ + Exynos_OSAL_QueueCreate(&pExynosOutputPort->bufferQ, MAX_QUEUE_ELEMENTS); /* For in case of "Output Buffer Share", MAX ELEMENTS(DPB + EDPB) */ pExynosOutputPort->extendBufferHeader = Exynos_OSAL_Malloc(sizeof(EXYNOS_OMX_BUFFERHEADERTYPE) * MAX_BUFFER_NUM); if (pExynosOutputPort->extendBufferHeader == NULL) { diff --git a/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.h b/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.h index e486555..1cc43a8 100644 --- a/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.h +++ b/exynos_omx/openmax/exynos_omx/component/common/Exynos_OMX_Baseport.h @@ -127,6 +127,7 @@ typedef enum _EXYNOS_OMX_EXCEPTION_STATE GENERAL_STATE = 0x00, NEED_PORT_FLUSH, NEED_PORT_DISABLE, + INVALID_STATE, } EXYNOS_OMX_EXCEPTION_STATE; typedef enum _EXYNOS_OMX_PLANE diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.c index aac1a9c..eed7bf1 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.c @@ -715,7 +715,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_SleepMillisec(0); if ((CHECK_PORT_BEING_FLUSHED(exynosInputPort)) || - ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == OMX_ErrorInputDataDecodeYet))) + ((exynosOutputPort->exceptionFlag != GENERAL_STATE) && (ret == OMX_ErrorInputDataDecodeYet))) break; if (exynosInputPort->portState != OMX_StateIdle) break; @@ -831,7 +831,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) EXYNOS_OMX_BASEPORT *exynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; EXYNOS_OMX_DATABUFFER *dstInputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.inputDataBuffer; EXYNOS_OMX_DATA dstInputData; - + FunctionIn(); while (!pVideoDec->bExitBufferProcessThread) { @@ -842,7 +842,8 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent) Exynos_OSAL_SleepMillisec(0); if ((CHECK_PORT_BEING_FLUSHED(exynosOutputPort)) || - (!CHECK_PORT_POPULATED(exynosOutputPort))) + (!CHECK_PORT_POPULATED(exynosOutputPort)) || + (exynosOutputPort->exceptionFlag != GENERAL_STATE)) break; if (exynosOutputPort->portState != OMX_StateIdle) break; @@ -1230,6 +1231,8 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeComponentInit(OMX_IN OMX_HANDLETYPE hCompone } Exynos_OSAL_Memset(pVideoDec, 0, sizeof(EXYNOS_OMX_VIDEODEC_COMPONENT)); + pVideoDec->bReconfigDPB = OMX_FALSE; + pVideoDec->nSavedDPBCnt = 0; pExynosComponent->hComponentHandle = (OMX_HANDLETYPE)pVideoDec; pExynosComponent->bSaveFlagEOS = OMX_FALSE; diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.h b/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.h index e7bee2d..468bbd2 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.h +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_Vdec.h @@ -107,6 +107,10 @@ typedef struct _EXYNOS_OMX_VIDEODEC_COMPONENT /* For DRM Play */ OMX_BOOL bDRMPlayerMode; + /* For Reconfiguration DPB */ + OMX_BOOL bReconfigDPB; + OMX_U32 nSavedDPBCnt; + /* CSC handle */ OMX_PTR csc_handle; OMX_U32 csc_set_format; @@ -127,6 +131,7 @@ typedef struct _EXYNOS_OMX_VIDEODEC_COMPONENT OMX_BOOL bPreviousFrameEOF, OMX_BOOL *pbEndOfFrame); OMX_ERRORTYPE (*exynos_codec_getCodecInputPrivateData) (OMX_PTR codecBuffer, OMX_PTR addr, OMX_U32 *size); OMX_ERRORTYPE (*exynos_codec_getCodecOutputPrivateData) (OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]); + OMX_ERRORTYPE (*exynos_codec_reconfigAllBuffers) (OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex); } EXYNOS_OMX_VIDEODEC_COMPONENT; #ifdef __cplusplus diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_VdecControl.c b/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_VdecControl.c index f5eb04e..d5b8478 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_VdecControl.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/Exynos_OMX_VdecControl.c @@ -413,6 +413,7 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por { OMX_ERRORTYPE ret = OMX_ErrorNone; EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; + EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; EXYNOS_OMX_BASEPORT *pExynosPort = NULL; OMX_BUFFERHEADERTYPE *bufferHeader = NULL; EXYNOS_OMX_DATABUFFER *pDataPortBuffer[2] = {NULL, NULL}; @@ -469,7 +470,10 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por } Exynos_ResetCodecData(&pExynosPort->processData); - maxBufferNum = pExynosPort->portDefinition.nBufferCountActual; + if (pVideoDec->bReconfigDPB == OMX_TRUE) + maxBufferNum = pVideoDec->nSavedDPBCnt; + else + maxBufferNum = pExynosPort->portDefinition.nBufferCountActual; for (i = 0; i < maxBufferNum; i++) { if (pExynosPort->extendBufferHeader[i].bBufferInOMX == OMX_TRUE) { if (portIndex == OUTPUT_PORT_INDEX) { @@ -562,7 +566,9 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n pVideoDec->exynos_codec_stop(pOMXComponent, nPortIndex); Exynos_OSAL_MutexLock(flushPortBuffer[1]->bufferMutex); ret = Exynos_OMX_FlushPort(pOMXComponent, nPortIndex); - if ((pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) == BUFFER_COPY) + if (pVideoDec->bReconfigDPB == OMX_TRUE) + pVideoDec->exynos_codec_reconfigAllBuffers(pOMXComponent, nPortIndex); + else if ((pExynosComponent->pExynosPort[nPortIndex].bufferProcessType & BUFFER_COPY) == BUFFER_COPY) pVideoDec->exynos_codec_enqueueAllBuffer(pOMXComponent, nPortIndex); Exynos_ResetCodecData(&pExynosPort->processData); diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c index 44a4c20..ec3eef2 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -590,6 +590,61 @@ EXIT: return ret; } +OMX_ERRORTYPE H264CodecReconfigAllBuffers( + OMX_COMPONENTTYPE *pOMXComponent, + OMX_U32 nPortIndex) +{ + OMX_ERRORTYPE ret = OMX_ErrorNone; + EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; + EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; + EXYNOS_OMX_BASEPORT *pExynosPort = &pExynosComponent->pExynosPort[nPortIndex]; + EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle; + void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; + ExynosVideoDecBufferOps *pBufferOps = NULL; + + FunctionIn(); + + if ((nPortIndex == INPUT_PORT_INDEX) && + (pH264Dec->bSourceStart == OMX_TRUE)) { + ret = OMX_ErrorNotImplemented; + goto EXIT; + } else if ((nPortIndex == OUTPUT_PORT_INDEX) && + (pH264Dec->bDestinationStart == OMX_TRUE)) { + pBufferOps = pH264Dec->hMFCH264Handle.pOutbufOps; + + if (pExynosPort->bufferProcessType & BUFFER_COPY) { + /**********************************/ + /* Codec Buffer Free & Unregister */ + /**********************************/ + Exynos_Free_CodecBuffers(pOMXComponent, OUTPUT_PORT_INDEX); + Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX); + pBufferOps->Clear_RegisteredBuffer(hMFCHandle); + pBufferOps->Cleanup_Buffer(hMFCHandle); + + /******************************************************/ + /* V4L2 Destnation Setup for DPB Buffer Number Change */ + /******************************************************/ + H264CodecDstSetup(pOMXComponent); + + pVideoDec->bReconfigDPB = OMX_FALSE; + } else if (pExynosPort->bufferProcessType & BUFFER_SHARE) { + /**********************************/ + /* Codec Buffer Unregister */ + /**********************************/ + pBufferOps->Clear_RegisteredBuffer(hMFCHandle); + pBufferOps->Cleanup_Buffer(hMFCHandle); + } + } else { + ret = OMX_ErrorBadParameter; + goto EXIT; + } + +EXIT: + FunctionOut(); + + return ret; +} + OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex) { OMX_ERRORTYPE ret = OMX_ErrorNone; @@ -648,6 +703,118 @@ EXIT: return ret; } +OMX_ERRORTYPE H264CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent) +{ + OMX_ERRORTYPE ret = OMX_ErrorNone; + EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate; + EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle; + EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle; + void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; + EXYNOS_OMX_BASEPORT *pInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; + EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; + ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; + ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps; + + FunctionIn(); + /* get geometry for output */ + Exynos_OSAL_Memset(&pH264Dec->hMFCH264Handle.codecOutbufConf, 0, sizeof(ExynosVideoGeometry)); + if (pOutbufOps->Get_Geometry(hMFCHandle, &pH264Dec->hMFCH264Handle.codecOutbufConf) != VIDEO_ERROR_NONE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to get geometry for parsed header info"); + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } + + /* get dpb count */ + pH264Dec->hMFCH264Handle.maxDPBNum = pDecOps->Get_ActualBufferCount(hMFCHandle); + if (pVideoDec->bThumbnailMode == OMX_FALSE) + pH264Dec->hMFCH264Handle.maxDPBNum += EXTRA_DPB_NUM; + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "H264CodecSetup nOutbufs: %d", pH264Dec->hMFCH264Handle.maxDPBNum); + + pH264Dec->hMFCH264Handle.bConfiguredMFCSrc = OMX_TRUE; + + pOutputPort->cropRectangle.nTop = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nTop; + pOutputPort->cropRectangle.nLeft = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nLeft; + pOutputPort->cropRectangle.nWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth; + pOutputPort->cropRectangle.nHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight; + + if (pVideoDec->bReconfigDPB == OMX_TRUE) + pVideoDec->nSavedDPBCnt = pOutputPort->portDefinition.nBufferCountActual; + + if (pOutputPort->bufferProcessType & BUFFER_COPY) { + if ((pVideoDec->bReconfigDPB) || + (pInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || + (pInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight)) { + pInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; + pInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; + pInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); + pInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); + + Exynos_UpdateFrameSize(pOMXComponent); + pOutputPort->exceptionFlag = NEED_PORT_DISABLE; + + /** Send Port Settings changed call back **/ + (*(pExynosComponent->pCallbacks->EventHandler)) + (pOMXComponent, + pExynosComponent->callbackData, + OMX_EventPortSettingsChanged, /* The command was completed */ + OMX_DirOutput, /* This is the port index */ + 0, + NULL); + } + } else if (pOutputPort->bufferProcessType & BUFFER_SHARE) { + if ((pVideoDec->bReconfigDPB) || + (pInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || + (pInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight) || + (pOutputPort->portDefinition.nBufferCountActual != pH264Dec->hMFCH264Handle.maxDPBNum)) { + pInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; + pInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; + pInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); + pInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); + + pOutputPort->portDefinition.nBufferCountActual = pH264Dec->hMFCH264Handle.maxDPBNum - 2; + pOutputPort->portDefinition.nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum - 2; + + Exynos_UpdateFrameSize(pOMXComponent); + pOutputPort->exceptionFlag = NEED_PORT_DISABLE; + + /** Send Port Settings changed call back **/ + (*(pExynosComponent->pCallbacks->EventHandler)) + (pOMXComponent, + pExynosComponent->callbackData, + OMX_EventPortSettingsChanged, /* The command was completed */ + OMX_DirOutput, /* This is the port index */ + 0, + NULL); + } + } + if ((pVideoDec->bReconfigDPB == OMX_TRUE) || + (pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth) || + (pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight)) { + /* Check Crop */ + pInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; + pInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; + pInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); + pInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); + Exynos_UpdateFrameSize(pOMXComponent); + + /** Send crop info call back **/ + (*(pExynosComponent->pCallbacks->EventHandler)) + (pOMXComponent, + pExynosComponent->callbackData, + OMX_EventPortSettingsChanged, /* The command was completed */ + OMX_DirOutput, /* This is the port index */ + OMX_IndexConfigCommonOutputCrop, + NULL); + } + + ret = OMX_ErrorNone; + +EXIT: + FunctionOut(); + + return ret; +} + OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA *pSrcInputData) { OMX_ERRORTYPE ret = OMX_ErrorNone; @@ -770,92 +937,7 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT goto EXIT; } - /* get geometry for output */ - Exynos_OSAL_Memset(&pH264Dec->hMFCH264Handle.codecOutbufConf, 0, sizeof(ExynosVideoGeometry)); - if (pOutbufOps->Get_Geometry(hMFCHandle, &pH264Dec->hMFCH264Handle.codecOutbufConf) != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to get geometry for parsed header info"); - ret = OMX_ErrorInsufficientResources; - goto EXIT; - } - - /* get dpb count */ - pH264Dec->hMFCH264Handle.maxDPBNum = pDecOps->Get_ActualBufferCount(hMFCHandle); - if (pVideoDec->bThumbnailMode == OMX_FALSE) - pH264Dec->hMFCH264Handle.maxDPBNum += EXTRA_DPB_NUM; - else - pH264Dec->hMFCH264Handle.maxDPBNum += PLATFORM_DISPLAY_BUFFER; - Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "H264CodecSetup nOutbufs: %d", pH264Dec->hMFCH264Handle.maxDPBNum); - - pH264Dec->hMFCH264Handle.bConfiguredMFCSrc = OMX_TRUE; - - pExynosOutputPort->cropRectangle.nTop = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nTop; - pExynosOutputPort->cropRectangle.nLeft = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nLeft; - pExynosOutputPort->cropRectangle.nWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth; - pExynosOutputPort->cropRectangle.nHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight; - - if ((pExynosOutputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) { - if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || - (pExynosInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight)) { - pExynosInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; - pExynosInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; - pExynosInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); - pExynosInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); - - Exynos_UpdateFrameSize(pOMXComponent); - pExynosOutputPort->exceptionFlag = NEED_PORT_DISABLE; - - /** Send Port Settings changed call back **/ - (*(pExynosComponent->pCallbacks->EventHandler)) - (pOMXComponent, - pExynosComponent->callbackData, - OMX_EventPortSettingsChanged, /* The command was completed */ - OMX_DirOutput, /* This is the port index */ - 0, - NULL); - } - } else if (pExynosOutputPort->bufferProcessType == BUFFER_SHARE) { - if ((pExynosInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) || - (pExynosInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight) || - (pExynosOutputPort->portDefinition.nBufferCountActual != pH264Dec->hMFCH264Handle.maxDPBNum)) { - pExynosInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; - pExynosInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; - pExynosInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); - pExynosInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); - - pExynosOutputPort->portDefinition.nBufferCountActual = pH264Dec->hMFCH264Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER; - pExynosOutputPort->portDefinition.nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER; - - Exynos_UpdateFrameSize(pOMXComponent); - pExynosOutputPort->exceptionFlag = NEED_PORT_DISABLE; - - /** Send Port Settings changed call back **/ - (*(pExynosComponent->pCallbacks->EventHandler)) - (pOMXComponent, - pExynosComponent->callbackData, - OMX_EventPortSettingsChanged, /* The command was completed */ - OMX_DirOutput, /* This is the port index */ - 0, - NULL); - } - } - if ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth) || - (pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight)) { - /* Check Crop */ - pExynosInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth; - pExynosInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight; - pExynosInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15)); - pExynosInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15)); - Exynos_UpdateFrameSize(pOMXComponent); - - /** Send crop info call back **/ - (*(pExynosComponent->pCallbacks->EventHandler)) - (pOMXComponent, - pExynosComponent->callbackData, - OMX_EventPortSettingsChanged, /* The command was completed */ - OMX_DirOutput, /* This is the port index */ - OMX_IndexConfigCommonOutputCrop, - NULL); - } + H264CodecCheckResolutionChange(pOMXComponent); Exynos_OSAL_SleepMillisec(0); ret = OMX_ErrorInputDataDecodeYet; @@ -1754,6 +1836,15 @@ OMX_ERRORTYPE Exynos_H264Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ pDstInputData->buffer.multiPlaneBuffer.fd[0], pDstInputData->buffer.multiPlaneBuffer.fd[1]); + if ((pVideoDec->bReconfigDPB == OMX_TRUE) && + (pExynosOutputPort->bufferProcessType & BUFFER_SHARE) && + (pExynosOutputPort->exceptionFlag == GENERAL_STATE)) { + ret = H264CodecDstSetup(pOMXComponent); + if (ret != OMX_ErrorNone) + goto EXIT; + pVideoDec->bReconfigDPB = OMX_FALSE; + } + OMX_U32 nAllocLen[VIDEO_BUFFER_MAX_PLANES] = {0, 0, 0}; nAllocLen[0] = pExynosOutputPort->portDefinition.format.video.nFrameWidth * pExynosOutputPort->portDefinition.format.video.nFrameHeight; nAllocLen[1] = pExynosOutputPort->portDefinition.format.video.nFrameWidth * pExynosOutputPort->portDefinition.format.video.nFrameHeight / 2; @@ -1764,8 +1855,10 @@ OMX_ERRORTYPE Exynos_H264Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ (unsigned int *)nAllocLen, (unsigned int *)dataLen, MFC_OUTPUT_BUFFER_PLANE, pDstInputData->bufferHeader); if (codecReturn != VIDEO_ERROR_NONE) { - Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__); - ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode; + if (codecReturn != VIDEO_ERROR_WRONGBUFFERSIZE) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s : %d", __FUNCTION__, __LINE__); + ret = (OMX_ERRORTYPE)OMX_ErrorCodecDecode; + } goto EXIT; } H264CodecStart(pOMXComponent, OUTPUT_PORT_INDEX); @@ -1819,6 +1912,7 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX if ((displayStatus == VIDEO_FRAME_STATUS_DISPLAY_DECODING) || (displayStatus == VIDEO_FRAME_STATUS_DISPLAY_ONLY) || (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || + (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { if (pVideoBuffer != NULL) { ret = OMX_ErrorNone; @@ -1830,6 +1924,19 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX } } + if ((pVideoDec->bThumbnailMode == OMX_FALSE) && + (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL)) { + if (pVideoDec->bReconfigDPB != OMX_TRUE) { + pExynosOutputPort->exceptionFlag = NEED_PORT_FLUSH; + pVideoDec->bReconfigDPB = OMX_TRUE; + H264CodecCheckResolutionChange(pOMXComponent); + pVideoDec->csc_set_format = OMX_FALSE; + } + Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "VIDEO_FRAME_STATUS_CHANGE_RESOL"); + ret = OMX_ErrorNone; + goto EXIT; + } + if (ret != OMX_ErrorNone) goto EXIT; @@ -1916,7 +2023,7 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX 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 ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || + if ((displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; @@ -2226,6 +2333,7 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent pVideoDec->exynos_checkInputFrame = &Check_H264_Frame; pVideoDec->exynos_codec_getCodecInputPrivateData = &GetCodecInputPrivateData; pVideoDec->exynos_codec_getCodecOutputPrivateData = &GetCodecOutputPrivateData; + pVideoDec->exynos_codec_reconfigAllBuffers = &H264CodecReconfigAllBuffers; pVideoDec->hSharedMemory = Exynos_OSAL_SharedMemory_Open(); if (pVideoDec->hSharedMemory == NULL) { diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 02e04ce..d72a7d2 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -1952,6 +1952,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM if ((displayStatus == VIDEO_FRAME_STATUS_DISPLAY_DECODING) || (displayStatus == VIDEO_FRAME_STATUS_DISPLAY_ONLY) || (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || + (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { if (pVideoBuffer != NULL) { ret = OMX_ErrorNone; @@ -2050,6 +2051,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM } if ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || + (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; diff --git a/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index 1e84929..746799c 100644 --- a/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/exynos_omx/openmax/exynos_omx/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -1542,6 +1542,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ if ((displayStatus == VIDEO_FRAME_STATUS_DISPLAY_DECODING) || (displayStatus == VIDEO_FRAME_STATUS_DISPLAY_ONLY) || (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || + (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { if (pVideoBuffer != NULL) { ret = OMX_ErrorNone; @@ -1643,6 +1644,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ } if ((displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || + (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || ((pDstOutputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) { Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "displayStatus:%d, nFlags0x%x", displayStatus, pDstOutputData->nFlags); pDstOutputData->remainDataLen = 0; |