diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-10-29 00:36:10 -0400 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-10-29 00:36:10 -0400 |
commit | b5df4517bbd71c4caedc24ffb44441ee8af58492 (patch) | |
tree | 6301972645045a045b900ebe5e679f149fada938 /nodes | |
parent | d3c71d2eba6839e773aa96b045668879067184d1 (diff) | |
parent | 8706fb7a9816dcf8c8148fa2b32d9bcc11ece423 (diff) | |
download | opencore-b5df4517bbd71c4caedc24ffb44441ee8af58492.tar.gz |
Merge change I59cd601c into eclair-mr2
* changes:
[RIO-7857] PVPlayer state transition handling when error event received from OMX component
Diffstat (limited to 'nodes')
-rw-r--r-- | nodes/pvomxaudiodecnode/src/pvmf_omx_audiodec_node.cpp | 6 | ||||
-rw-r--r-- | nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp | 137 | ||||
-rw-r--r-- | nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp | 6 |
3 files changed, 60 insertions, 89 deletions
diff --git a/nodes/pvomxaudiodecnode/src/pvmf_omx_audiodec_node.cpp b/nodes/pvomxaudiodecnode/src/pvmf_omx_audiodec_node.cpp index b1159f7a1..29d30f418 100644 --- a/nodes/pvomxaudiodecnode/src/pvmf_omx_audiodec_node.cpp +++ b/nodes/pvomxaudiodecnode/src/pvmf_omx_audiodec_node.cpp @@ -1956,6 +1956,12 @@ OMX_ERRORTYPE PVMFOMXAudioDecNode::EventHandlerProcessing(OMX_OUT OMX_HANDLETYPE ReportInfoEvent(PVMFInfoProcessingFailure, NULL); } + else if (aData1 == (OMX_U32) OMX_ErrorInvalidState) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR, + (0, "PVMFOMXAudioDecNode::EventHandlerProcessing: OMX_EventError - OMX_ErrorInvalidState")); + HandleComponentStateChange(OMX_StateInvalid); + } else { diff --git a/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp b/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp index f6d49e05e..a1e339b1b 100644 --- a/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp +++ b/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp @@ -3574,6 +3574,46 @@ OSCL_EXPORT_REF void PVMFOMXBaseDecNode::HandleComponentStateChange(OMX_U32 deco PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR, (0, "%s::HandleComponentStateChange: OMX_StateInvalid reached", iName.Str())); + //Cleanup encoder + DeleteOMXBaseDecoder(); + + if (iCurrentCommand.size() > 0) + {// CANNOT be CANCEL or CANCEL_ALL. Just to cmd completion for the reset + if (iCurrentCommand.front().iCmd == PVMFOMXBaseDecNodeCommand::PVOMXBASEDEC_NODE_CMD_RESET) + { + //delete all ports and notify observer. + if (iInPort) + { + OSCL_DELETE(((PVMFOMXDecPort*)iInPort)); + iInPort = NULL; + } + + if (iOutPort) + { + OSCL_DELETE(((PVMFOMXDecPort*)iOutPort)); + iOutPort = NULL; + } + + iDataIn.Unbind(); + + // Reset the metadata key list + iAvailableMetadataKeys.clear(); + + iEndOfDataReached = false; + iIsEOSSentToComponent = false; + iIsEOSReceivedFromComponent = false; + + iProcessingState = EPVMFOMXBaseDecNodeProcessingState_Idle; + //logoff & go back to Created state. + SetState(EPVMFNodeIdle); + CommandComplete(iCurrentCommand, iCurrentCommand.front(), PVMFSuccess); + } + else + { + SetState(EPVMFNodeError); + CommandComplete(iCurrentCommand, iCurrentCommand.front(), PVMFErrResource); + } + } break; }//end of case OMX_StateInvalid @@ -4803,26 +4843,7 @@ void PVMFOMXBaseDecNode::DoReset(PVMFOMXBaseDecNodeCommand& aCmd) err = OMX_GetState(iOMXDecoder, &sState); if (err != OMX_ErrorNone) { - //Error condition report - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, - (0, "%s::DoReset(): Can't get State of decoder!", iName.Str())); - if (iResetInProgress) - { - // cmd is in current q - iResetInProgress = false; - if ((iCurrentCommand.size() > 0) && - (iCurrentCommand.front().iCmd == PVMFOMXBaseDecNodeCommand::PVOMXBASEDEC_NODE_CMD_RESET) - ) - { - CommandComplete(iCurrentCommand, iCurrentCommand.front(), PVMFErrResource); - } - - } - else - { - CommandComplete(iInputCommands, aCmd, PVMFErrResource); - } - return; + sState = OMX_StateInvalid; } if (sState == OMX_StateLoaded) @@ -4836,58 +4857,9 @@ void PVMFOMXBaseDecNode::DoReset(PVMFOMXBaseDecNodeCommand& aCmd) (0, "%s::DoReset() OMX comp is in loaded state. Wait for official callback to change variables etc.", iName.Str())); return; } - else - { - - //CommandComplete(iInputCommands, aCmd, PVMFErrResource); - //delete all ports and notify observer. - if (iInPort) - { - OSCL_DELETE(((PVMFOMXDecPort*)iInPort)); - iInPort = NULL; - } - - if (iOutPort) - { - OSCL_DELETE(((PVMFOMXDecPort*)iOutPort)); - iOutPort = NULL; - } - - iDataIn.Unbind(); - - - // Reset the metadata key list - iAvailableMetadataKeys.clear(); - - iEndOfDataReached = false; - iIsEOSSentToComponent = false; - iIsEOSReceivedFromComponent = false; - - if (iOMXComponentUsesFullAVCFrames) - { - iNALCount = 0; - oscl_memset(iNALSizeArray, 0, sizeof(uint32) * MAX_NAL_PER_FRAME); // 100 is max number of NALs - } - - // reset dynamic port reconfig flags - no point continuing with port reconfig - // if we start again - we'll have to do prepare and send new config etc. - iSecondPortReportedChange = false; - iDynamicReconfigInProgress = false; - - iProcessingState = EPVMFOMXBaseDecNodeProcessingState_Idle; - - SetState(EPVMFNodeIdle); - - CommandComplete(iInputCommands, aCmd, PVMFSuccess); - - return; - } } - - if (sState == OMX_StateIdle) + else if (sState == OMX_StateIdle) { - - //this command is asynchronous. move the command from //the input command queue to the current command, where //it will remain until it is completed. @@ -5008,8 +4980,7 @@ void PVMFOMXBaseDecNode::DoReset(PVMFOMXBaseDecNodeCommand& aCmd) return; } - - if ((sState == OMX_StateExecuting) || (sState == OMX_StatePause)) + else if ((sState == OMX_StateExecuting) || (sState == OMX_StatePause)) { //this command is asynchronous. move the command from //the input command queue to the current command, where @@ -5085,23 +5056,11 @@ void PVMFOMXBaseDecNode::DoReset(PVMFOMXBaseDecNodeCommand& aCmd) { //Error condition report PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, - (0, "%s::DoReset(): Decoder is not in the Idle state!", iName.Str())); - if (iResetInProgress) - { - iResetInProgress = false; - if ((iCurrentCommand.size() > 0) && - (iCurrentCommand.front().iCmd == PVMFOMXBaseDecNodeCommand::PVOMXBASEDEC_NODE_CMD_RESET) - ) - { - CommandComplete(iCurrentCommand, iCurrentCommand.front(), PVMFErrInvalidState); - } - } - else - { - CommandComplete(iInputCommands, aCmd, PVMFErrInvalidState); - } - break; - }//end of if (sState == OMX_StateIdle) + (0, "%s::DoReset(): Decoder is not in the Idle state! %d", iName.Str(), sState)); + //do it here rather than relying on DTOR to avoid node reinit problems. + DeleteOMXBaseDecoder(); + //still return success. + }//end of if (sState == OMX_StateLoaded) }//end of if (iOMXDecoder != NULL) //delete all ports and notify observer. diff --git a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp index 70f9ddf6b..768680077 100644 --- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp +++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp @@ -1374,6 +1374,12 @@ OMX_ERRORTYPE PVMFOMXVideoDecNode::EventHandlerProcessing(OMX_OUT OMX_HANDLETYPE ReportInfoEvent(PVMFInfoProcessingFailure, NULL); } + else if (aData1 == (OMX_U32) OMX_ErrorInvalidState) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR, + (0, "PVMFOMXVideoDecNode::EventHandlerProcessing: OMX_EventError - OMX_ErrorInvalidState")); + HandleComponentStateChange(OMX_StateInvalid); + } else { |