} else {
if (CHECK_PORT_ENABLED(pExynosPort)) {
Exynos_OSAL_SemaphoreWait(pExynosComponent->pExynosPort[i].loadedResource);
+ if (pExynosComponent->abendState == OMX_TRUE) {
+ Exynos_OSAL_SignalSet(pExynosComponent->abendStateEvent);
+ ret = Exynos_OMX_Release_Resource(pOMXComponent);
+ goto EXIT;
+ }
pExynosPort->portDefinition.bPopulated = OMX_TRUE;
}
}
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__);
goto EXIT;
}
+ ret = Exynos_OSAL_SignalCreate(&pExynosComponent->abendStateEvent);
+ if (ret != OMX_ErrorNone) {
+ ret = OMX_ErrorInsufficientResources;
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "OMX_ErrorInsufficientResources, Line:%d", __LINE__);
+ goto EXIT;
+ }
pExynosComponent->bExitMessageHandlerThread = OMX_FALSE;
Exynos_OSAL_QueueCreate(&pExynosComponent->messageQ, MAX_QUEUE_ELEMENTS);
Exynos_OSAL_ThreadTerminate(pExynosComponent->hMessageHandler);
pExynosComponent->hMessageHandler = NULL;
+ Exynos_OSAL_SignalTerminate(pExynosComponent->abendStateEvent);
+ pExynosComponent->abendStateEvent = NULL;
Exynos_OSAL_MutexTerminate(pExynosComponent->compMutex);
pExynosComponent->compMutex = NULL;
Exynos_OSAL_SemaphoreTerminate(pExynosComponent->msgSemaphoreHandle);
OMX_ERRORTYPE Exynos_OMX_Port_Destructor(OMX_HANDLETYPE hComponent)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- OMX_COMPONENTTYPE *pOMXComponent = NULL;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- FunctionIn();
-
+ OMX_S32 countValue = 0;
int i = 0;
+ FunctionIn();
+
if (hComponent == NULL) {
ret = OMX_ErrorBadParameter;
goto EXIT;
goto EXIT;
}
pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
+
+ if (pExynosComponent->transientState == EXYNOS_OMX_TransStateLoadedToIdle) {
+ pExynosComponent->abendState = OMX_TRUE;
+ for (i = 0; i < ALL_PORT_NUM; i++) {
+ pExynosPort = &pExynosComponent->pExynosPort[i];
+ Exynos_OSAL_SemaphorePost(pExynosPort->loadedResource);
+ }
+ Exynos_OSAL_SignalWait(pExynosComponent->abendStateEvent, DEF_MAX_WAIT_TIME);
+ Exynos_OSAL_SignalReset(pExynosComponent->abendStateEvent);
+ }
+
for (i = 0; i < ALL_PORT_NUM; i++) {
pExynosPort = &pExynosComponent->pExynosPort[i];