diff options
author | ywan171 <yi.a.wang@intel.com> | 2014-03-03 08:54:10 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:03:43 -0700 |
commit | 86c08d74951f4c563b1343c5b1735742fc734372 (patch) | |
tree | 216201e0565b0ba059ffbbab92fd5b1fa3d1aa79 /base/src/componentbase.cpp | |
parent | 41e08b779bbfab77f59765aa470aa93e2d81b877 (diff) | |
download | wrs_omxil_core-86c08d74951f4c563b1343c5b1735742fc734372.tar.gz |
wrs_core: add timeout wait event when decoder component transits from loaded to idle
BZ: 176001
the decoder component will wait for all output buffer being set from the client before
transiting from loaded to idle state, so if the output buffer allocation fails in client,
ANR will happen. add timeout wait event when decoder component transits from loaded to idle
Change-Id: I5a4651646c48fc22483aba32c86e9a7bea58eb89
Signed-off-by: ywan171 <yi.a.wang@intel.com>
Diffstat (limited to 'base/src/componentbase.cpp')
-rw-r--r-- | base/src/componentbase.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/base/src/componentbase.cpp b/base/src/componentbase.cpp index e1ef01a..a9388ef 100644 --- a/base/src/componentbase.cpp +++ b/base/src/componentbase.cpp @@ -1432,16 +1432,24 @@ out: inline OMX_ERRORTYPE ComponentBase::TransStateToIdle(OMX_STATETYPE current) { - OMX_ERRORTYPE ret; + OMX_ERRORTYPE ret = OMX_ErrorNone; if (current == OMX_StateLoaded) { OMX_U32 i; for (i = 0; i < nr_ports; i++) { - if (ports[i]->IsEnabled()) - ports[i]->WaitPortBufferCompletion(); + if (ports[i]->IsEnabled()) { + if (GetWorkingRole() != NULL && + !strncmp (GetWorkingRole(),"video_decoder", 13 )) { + ret = ports[i]->WaitPortBufferCompletionTimeout(800); + } else { + ports[i]->WaitPortBufferCompletion(); + } + } } - ret = ProcessorInit(); + if (ret == OMX_ErrorNone) { + ret = ProcessorInit(); + } if (ret != OMX_ErrorNone) { LOGE("%s:%s: ProcessorInit() failed (ret : 0x%08x)\n", GetName(), GetWorkingRole(), ret); |