Loading include/media/IOMX.h +3 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,9 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size) = 0; virtual status_t getState( node_id node, OMX_STATETYPE* state) = 0; virtual status_t storeMetaDataInBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; Loading media/libmedia/IOMX.cpp +26 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ enum { SET_PARAMETER, GET_CONFIG, SET_CONFIG, GET_STATE, ENABLE_GRAPHIC_BUFFERS, USE_BUFFER, USE_GRAPHIC_BUFFER, Loading Loading @@ -198,6 +199,17 @@ public: return reply.readInt32(); } virtual status_t getState( node_id node, OMX_STATETYPE* state) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); remote()->transact(GET_STATE, data, &reply); *state = static_cast<OMX_STATETYPE>(reply.readInt32()); return reply.readInt32(); } virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) { Parcel data, reply; Loading Loading @@ -524,6 +536,20 @@ status_t BnOMX::onTransact( return NO_ERROR; } case GET_STATE: { CHECK_INTERFACE(IOMX, data, reply); node_id node = (void*)data.readIntPtr(); OMX_STATETYPE state = OMX_StateInvalid; status_t err = getState(node, &state); reply->writeInt32(state); reply->writeInt32(err); return NO_ERROR; } case ENABLE_GRAPHIC_BUFFERS: { CHECK_INTERFACE(IOMX, data, reply); Loading media/libstagefright/OMXCodec.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -3609,10 +3609,23 @@ status_t OMXCodec::stop() { mAsyncCompletion.wait(mLock); } bool isError = false; switch (mState) { case LOADED: break; case ERROR: { OMX_STATETYPE state = OMX_StateInvalid; status_t err = mOMX->getState(mNode, &state); CHECK_EQ(err, (status_t)OK); if (state != OMX_StateExecuting) { break; } // else fall through to the idling code isError = true; } case EXECUTING: { Loading Loading @@ -3648,6 +3661,12 @@ status_t OMXCodec::stop() { mAsyncCompletion.wait(mLock); } if (isError) { // We were in the ERROR state coming in, so restore that now // that we've idled the OMX component. setState(ERROR); } break; } Loading media/libstagefright/include/OMX.h +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size); virtual status_t getState( node_id node, OMX_STATETYPE* state); virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable); Loading media/libstagefright/include/OMXNodeInstance.h +2 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ struct OMXNodeInstance { status_t getConfig(OMX_INDEXTYPE index, void *params, size_t size); status_t setConfig(OMX_INDEXTYPE index, const void *params, size_t size); status_t getState(OMX_STATETYPE* state); status_t enableGraphicBuffers(OMX_U32 portIndex, OMX_BOOL enable); status_t getGraphicBufferUsage(OMX_U32 portIndex, OMX_U32* usage); Loading Loading
include/media/IOMX.h +3 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,9 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size) = 0; virtual status_t getState( node_id node, OMX_STATETYPE* state) = 0; virtual status_t storeMetaDataInBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; Loading
media/libmedia/IOMX.cpp +26 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ enum { SET_PARAMETER, GET_CONFIG, SET_CONFIG, GET_STATE, ENABLE_GRAPHIC_BUFFERS, USE_BUFFER, USE_GRAPHIC_BUFFER, Loading Loading @@ -198,6 +199,17 @@ public: return reply.readInt32(); } virtual status_t getState( node_id node, OMX_STATETYPE* state) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); remote()->transact(GET_STATE, data, &reply); *state = static_cast<OMX_STATETYPE>(reply.readInt32()); return reply.readInt32(); } virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) { Parcel data, reply; Loading Loading @@ -524,6 +536,20 @@ status_t BnOMX::onTransact( return NO_ERROR; } case GET_STATE: { CHECK_INTERFACE(IOMX, data, reply); node_id node = (void*)data.readIntPtr(); OMX_STATETYPE state = OMX_StateInvalid; status_t err = getState(node, &state); reply->writeInt32(state); reply->writeInt32(err); return NO_ERROR; } case ENABLE_GRAPHIC_BUFFERS: { CHECK_INTERFACE(IOMX, data, reply); Loading
media/libstagefright/OMXCodec.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -3609,10 +3609,23 @@ status_t OMXCodec::stop() { mAsyncCompletion.wait(mLock); } bool isError = false; switch (mState) { case LOADED: break; case ERROR: { OMX_STATETYPE state = OMX_StateInvalid; status_t err = mOMX->getState(mNode, &state); CHECK_EQ(err, (status_t)OK); if (state != OMX_StateExecuting) { break; } // else fall through to the idling code isError = true; } case EXECUTING: { Loading Loading @@ -3648,6 +3661,12 @@ status_t OMXCodec::stop() { mAsyncCompletion.wait(mLock); } if (isError) { // We were in the ERROR state coming in, so restore that now // that we've idled the OMX component. setState(ERROR); } break; } Loading
media/libstagefright/include/OMX.h +3 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size); virtual status_t getState( node_id node, OMX_STATETYPE* state); virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable); Loading
media/libstagefright/include/OMXNodeInstance.h +2 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ struct OMXNodeInstance { status_t getConfig(OMX_INDEXTYPE index, void *params, size_t size); status_t setConfig(OMX_INDEXTYPE index, const void *params, size_t size); status_t getState(OMX_STATETYPE* state); status_t enableGraphicBuffers(OMX_U32 portIndex, OMX_BOOL enable); status_t getGraphicBufferUsage(OMX_U32 portIndex, OMX_U32* usage); Loading