diff options
author | Tang Guifang <guifang.tang@intel.com> | 2013-02-01 04:33:19 -0500 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:03:40 -0700 |
commit | eb35431c93ec1d8457fb13fd76c980c72528504a (patch) | |
tree | bd26b96eb25dd3f1753dbf67684bd8017f110d96 | |
parent | 274e417839e9335eccada4b08e082e238b0ed7dc (diff) | |
download | wrs_omxil_core-eb35431c93ec1d8457fb13fd76c980c72528504a.tar.gz |
[PORT FROM R4.1] Set state when TransState is completed.
BZ: 79676
When OMX client died for exception, it will force setting to specific state
and then free the corresponding node. Component set state before all operation
done, then the node instance is freed, but component will continue to call
it's callback, and cause crash. State should be set after all operations done.
Change-Id: Ied8f0ad5e7ce979f17f8feedb70dafc44213c2a1
Reviewed-on: http://android.intel.com:8080/90186
Reviewed-by: Gu, Wangyi <wangyi.gu@intel.com>
Reviewed-by: Tang, Guifang <guifang.tang@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Wang, Yi A <yi.a.wang@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: Gozalvez Herrero, Juan AntonioX <juan.antoniox.gozalvez.herrero@intel.com>
Tested-by: Gozalvez Herrero, Juan AntonioX <juan.antoniox.gozalvez.herrero@intel.com>
-rw-r--r-- | base/src/componentbase.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/src/componentbase.cpp b/base/src/componentbase.cpp index 17e27b7..e736a66 100644 --- a/base/src/componentbase.cpp +++ b/base/src/componentbase.cpp @@ -1232,6 +1232,7 @@ static inline const char *GetStateName(OMX_STATETYPE state) void ComponentBase::TransState(OMX_STATETYPE transition) { OMX_STATETYPE current = this->state; + OMX_STATETYPE dest = this->state; OMX_EVENTTYPE event; OMX_U32 data1, data2; OMX_ERRORTYPE ret; @@ -1277,7 +1278,7 @@ notify_event: data1 = OMX_CommandStateSet; data2 = transition; - state = transition; + dest = transition; LOGD("%s:%s: transition from %s to %s completed", GetName(), GetWorkingRole(), GetStateName(current), GetStateName(transition)); @@ -1288,7 +1289,7 @@ notify_event: data2 = 0; if (transition == OMX_StateInvalid || ret == OMX_ErrorInvalidState) { - state = OMX_StateInvalid; + dest = OMX_StateInvalid; LOGE("%s:%s: exit failure, transition from %s to %s, " "current state is %s\n", GetName(), GetWorkingRole(), GetStateName(current), @@ -1302,6 +1303,7 @@ notify_event: if (ret == OMX_ErrorNone && transition == OMX_StateWaitForResources) callbacks->EventHandler(handle, appdata, OMX_EventResourcesAcquired, 0, 0, NULL); + state = dest; } inline OMX_ERRORTYPE ComponentBase::TransStateToLoaded(OMX_STATETYPE current) |