}
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)) {
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;
GENERAL_STATE = 0x00,
NEED_PORT_FLUSH,
NEED_PORT_DISABLE,
+ INVALID_STATE,
} EXYNOS_OMX_EXCEPTION_STATE;
typedef enum _EXYNOS_OMX_PLANE
Exynos_OSAL_SleepMillisec(0);
if ((CHECK_PORT_BEING_FLUSHED(exynosInputPort)) ||
- ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == OMX_ErrorInputDataDecodeYet)))
+ ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == OMX_ErrorInputDataDecodeYet)) ||
+ (exynosOutputPort->exceptionFlag == INVALID_STATE))
break;
if (exynosInputPort->portState != OMX_StateIdle)
break;
goto EXIT;
}
- if ((pExynosPort->portState != OMX_StateLoaded) && (pExynosPort->portState != OMX_StateInvalid)) {
+ if (((pExynosPort->portState != OMX_StateLoaded) &&
+ (pExynosPort->portState != OMX_StateInvalid)) &&
+ (pExynosPort->portDefinition.bEnabled != OMX_FALSE)) {
(*(pExynosComponent->pCallbacks->EventHandler)) (pOMXComponent,
pExynosComponent->callbackData,
(OMX_U32)OMX_EventError,
(OMX_U32)OMX_ErrorPortUnpopulated,
nPortIndex, NULL);
+ ret = OMX_ErrorInvalidState;
+ goto EXIT;
}
for (i = 0; i < /*pExynosPort->portDefinition.nBufferCountActual*/MAX_BUFFER_NUM; i++) {
goto EXIT;
}
- if ((pExynosPort->portState != OMX_StateLoaded) &&
- (pExynosPort->portState != OMX_StateInvalid)) {
+ if (((pExynosPort->portState != OMX_StateLoaded) &&
+ (pExynosPort->portState != OMX_StateInvalid)) &&
+ (pExynosPort->portDefinition.bEnabled != OMX_FALSE)) {
(*(pExynosComponent->pCallbacks->EventHandler)) (pOMXComponent,
pExynosComponent->callbackData,
(OMX_U32)OMX_EventError,
(OMX_U32)OMX_ErrorPortUnpopulated,
nPortIndex, NULL);
+ ret = OMX_ErrorInvalidState;
+ goto EXIT;
}
for (i = 0; i < /*pExynosPort->portDefinition.nBufferCountActual*/MAX_BUFFER_NUM; i++) {