Loading include/media/IOMX.h +10 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,16 @@ public: node_id node, const char *parameter_name, OMX_INDEXTYPE *index) = 0; enum InternalOptionType { INTERNAL_OPTION_SUSPEND, // data is a bool }; virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size) = 0; }; struct omx_message { Loading media/libmedia/IOMX.cpp +29 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ enum { GET_EXTENSION_INDEX, OBSERVER_ON_MSG, GET_GRAPHIC_BUFFER_USAGE, SET_INTERNAL_OPTION, }; class BpOMX : public BpInterface<IOMX> { Loading Loading @@ -439,6 +440,24 @@ public: return err; } virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *optionData, size_t size) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); data.writeInt32(port_index); data.writeInt32(size); data.write(optionData, size); data.writeInt32(type); remote()->transact(SET_INTERNAL_OPTION, data, &reply); return reply.readInt32(); } }; IMPLEMENT_META_INTERFACE(OMX, "android.hardware.IOMX"); Loading Loading @@ -537,6 +556,7 @@ status_t BnOMX::onTransact( case SET_PARAMETER: case GET_CONFIG: case SET_CONFIG: case SET_INTERNAL_OPTION: { CHECK_OMX_INTERFACE(IOMX, data, reply); Loading @@ -562,6 +582,15 @@ status_t BnOMX::onTransact( case SET_CONFIG: err = setConfig(node, index, params, size); break; case SET_INTERNAL_OPTION: { InternalOptionType type = (InternalOptionType)data.readInt32(); err = setInternalOption(node, index, type, params, size); break; } default: TRESPASS(); } Loading media/libstagefright/ACodec.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -4106,6 +4106,19 @@ status_t ACodec::setParameters(const sp<AMessage> ¶ms) { } } int32_t dropInputFrames; if (params->findInt32("drop-input-frames", &dropInputFrames)) { bool suspend = dropInputFrames != 0; CHECK_EQ((status_t)OK, mOMX->setInternalOption( mNode, kPortIndexInput, IOMX::INTERNAL_OPTION_SUSPEND, &suspend, sizeof(suspend))); } return OK; } Loading media/libstagefright/OMXClient.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,13 @@ struct MuxOMX : public IOMX { const char *parameter_name, OMX_INDEXTYPE *index); virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size); private: mutable Mutex mLock; Loading Loading @@ -331,6 +338,15 @@ status_t MuxOMX::getExtensionIndex( return getOMX(node)->getExtensionIndex(node, parameter_name, index); } status_t MuxOMX::setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size) { return getOMX(node)->setInternalOption(node, port_index, type, data, size); } OMXClient::OMXClient() { } Loading media/libstagefright/include/OMX.h +7 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,13 @@ public: const char *parameter_name, OMX_INDEXTYPE *index); virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size); virtual void binderDied(const wp<IBinder> &the_late_who); OMX_ERRORTYPE OnEvent( Loading Loading
include/media/IOMX.h +10 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,16 @@ public: node_id node, const char *parameter_name, OMX_INDEXTYPE *index) = 0; enum InternalOptionType { INTERNAL_OPTION_SUSPEND, // data is a bool }; virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size) = 0; }; struct omx_message { Loading
media/libmedia/IOMX.cpp +29 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ enum { GET_EXTENSION_INDEX, OBSERVER_ON_MSG, GET_GRAPHIC_BUFFER_USAGE, SET_INTERNAL_OPTION, }; class BpOMX : public BpInterface<IOMX> { Loading Loading @@ -439,6 +440,24 @@ public: return err; } virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *optionData, size_t size) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); data.writeInt32(port_index); data.writeInt32(size); data.write(optionData, size); data.writeInt32(type); remote()->transact(SET_INTERNAL_OPTION, data, &reply); return reply.readInt32(); } }; IMPLEMENT_META_INTERFACE(OMX, "android.hardware.IOMX"); Loading Loading @@ -537,6 +556,7 @@ status_t BnOMX::onTransact( case SET_PARAMETER: case GET_CONFIG: case SET_CONFIG: case SET_INTERNAL_OPTION: { CHECK_OMX_INTERFACE(IOMX, data, reply); Loading @@ -562,6 +582,15 @@ status_t BnOMX::onTransact( case SET_CONFIG: err = setConfig(node, index, params, size); break; case SET_INTERNAL_OPTION: { InternalOptionType type = (InternalOptionType)data.readInt32(); err = setInternalOption(node, index, type, params, size); break; } default: TRESPASS(); } Loading
media/libstagefright/ACodec.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -4106,6 +4106,19 @@ status_t ACodec::setParameters(const sp<AMessage> ¶ms) { } } int32_t dropInputFrames; if (params->findInt32("drop-input-frames", &dropInputFrames)) { bool suspend = dropInputFrames != 0; CHECK_EQ((status_t)OK, mOMX->setInternalOption( mNode, kPortIndexInput, IOMX::INTERNAL_OPTION_SUSPEND, &suspend, sizeof(suspend))); } return OK; } Loading
media/libstagefright/OMXClient.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,13 @@ struct MuxOMX : public IOMX { const char *parameter_name, OMX_INDEXTYPE *index); virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size); private: mutable Mutex mLock; Loading Loading @@ -331,6 +338,15 @@ status_t MuxOMX::getExtensionIndex( return getOMX(node)->getExtensionIndex(node, parameter_name, index); } status_t MuxOMX::setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size) { return getOMX(node)->setInternalOption(node, port_index, type, data, size); } OMXClient::OMXClient() { } Loading
media/libstagefright/include/OMX.h +7 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,13 @@ public: const char *parameter_name, OMX_INDEXTYPE *index); virtual status_t setInternalOption( node_id node, OMX_U32 port_index, InternalOptionType type, const void *data, size_t size); virtual void binderDied(const wp<IBinder> &the_late_who); OMX_ERRORTYPE OnEvent( Loading