Loading include/media/IOMX.h +4 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,10 @@ public: node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer) = 0; virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer) = 0; // This will set *type to resulting metadata buffer type on OMX error (not on binder error) as // well as on success. virtual status_t createInputSurface( Loading media/libmedia/IOMX.cpp +39 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <media/IOMX.h> #include <media/stagefright/foundation/ADebug.h> #include <media/openmax/OMX_IndexExt.h> #include <utils/NativeHandle.h> namespace android { Loading Loading @@ -60,6 +61,7 @@ enum { SET_INTERNAL_OPTION, UPDATE_GRAPHIC_BUFFER_IN_META, CONFIGURE_VIDEO_TUNNEL_MODE, UPDATE_NATIVE_HANDLE_IN_META, }; class BpOMX : public BpInterface<IOMX> { Loading Loading @@ -313,6 +315,24 @@ public: return err; } virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32(port_index); data.writeInt32(nativeHandle != NULL); if (nativeHandle != NULL) { data.writeNativeHandle(nativeHandle->handle()); } data.writeInt32((int32_t)buffer); remote()->transact(UPDATE_NATIVE_HANDLE_IN_META, data, &reply); status_t err = reply.readInt32(); return err; } virtual status_t createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, MetadataBufferType *type) { Loading Loading @@ -908,6 +928,25 @@ status_t BnOMX::onTransact( return NO_ERROR; } case UPDATE_NATIVE_HANDLE_IN_META: { CHECK_OMX_INTERFACE(IOMX, data, reply); node_id node = (node_id)data.readInt32(); OMX_U32 port_index = data.readInt32(); native_handle *handle = NULL; if (data.readInt32()) { handle = data.readNativeHandle(); } buffer_id buffer = (buffer_id)data.readInt32(); status_t err = updateNativeHandleInMeta( node, port_index, NativeHandle::create(handle, true /* ownshandle */), buffer); reply->writeInt32(err); return NO_ERROR; } case CREATE_INPUT_SURFACE: { CHECK_OMX_INTERFACE(IOMX, data, reply); Loading media/libstagefright/OMXClient.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,10 @@ struct MuxOMX : public IOMX { node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer); virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer); virtual status_t createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, MetadataBufferType *type); Loading Loading @@ -387,6 +391,13 @@ status_t MuxOMX::updateGraphicBufferInMeta( node, port_index, graphicBuffer, buffer); } status_t MuxOMX::updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer) { return getOMX(node)->updateNativeHandleInMeta( node, port_index, nativeHandle, buffer); } status_t MuxOMX::createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, MetadataBufferType *type) { Loading media/libstagefright/include/OMX.h +4 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,10 @@ public: node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer); virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer); virtual status_t createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, Loading media/libstagefright/include/OMXNodeInstance.h +4 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,10 @@ struct OMXNodeInstance { OMX_U32 portIndex, const sp<GraphicBuffer> &graphicBuffer, OMX::buffer_id buffer); status_t updateNativeHandleInMeta( OMX_U32 portIndex, const sp<NativeHandle> &nativeHandle, OMX::buffer_id buffer); status_t createInputSurface( OMX_U32 portIndex, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, Loading Loading
include/media/IOMX.h +4 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,10 @@ public: node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer) = 0; virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer) = 0; // This will set *type to resulting metadata buffer type on OMX error (not on binder error) as // well as on success. virtual status_t createInputSurface( Loading
media/libmedia/IOMX.cpp +39 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <media/IOMX.h> #include <media/stagefright/foundation/ADebug.h> #include <media/openmax/OMX_IndexExt.h> #include <utils/NativeHandle.h> namespace android { Loading Loading @@ -60,6 +61,7 @@ enum { SET_INTERNAL_OPTION, UPDATE_GRAPHIC_BUFFER_IN_META, CONFIGURE_VIDEO_TUNNEL_MODE, UPDATE_NATIVE_HANDLE_IN_META, }; class BpOMX : public BpInterface<IOMX> { Loading Loading @@ -313,6 +315,24 @@ public: return err; } virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32(port_index); data.writeInt32(nativeHandle != NULL); if (nativeHandle != NULL) { data.writeNativeHandle(nativeHandle->handle()); } data.writeInt32((int32_t)buffer); remote()->transact(UPDATE_NATIVE_HANDLE_IN_META, data, &reply); status_t err = reply.readInt32(); return err; } virtual status_t createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, MetadataBufferType *type) { Loading Loading @@ -908,6 +928,25 @@ status_t BnOMX::onTransact( return NO_ERROR; } case UPDATE_NATIVE_HANDLE_IN_META: { CHECK_OMX_INTERFACE(IOMX, data, reply); node_id node = (node_id)data.readInt32(); OMX_U32 port_index = data.readInt32(); native_handle *handle = NULL; if (data.readInt32()) { handle = data.readNativeHandle(); } buffer_id buffer = (buffer_id)data.readInt32(); status_t err = updateNativeHandleInMeta( node, port_index, NativeHandle::create(handle, true /* ownshandle */), buffer); reply->writeInt32(err); return NO_ERROR; } case CREATE_INPUT_SURFACE: { CHECK_OMX_INTERFACE(IOMX, data, reply); Loading
media/libstagefright/OMXClient.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,10 @@ struct MuxOMX : public IOMX { node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer); virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer); virtual status_t createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, MetadataBufferType *type); Loading Loading @@ -387,6 +391,13 @@ status_t MuxOMX::updateGraphicBufferInMeta( node, port_index, graphicBuffer, buffer); } status_t MuxOMX::updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer) { return getOMX(node)->updateNativeHandleInMeta( node, port_index, nativeHandle, buffer); } status_t MuxOMX::createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, MetadataBufferType *type) { Loading
media/libstagefright/include/OMX.h +4 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,10 @@ public: node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer); virtual status_t updateNativeHandleInMeta( node_id node, OMX_U32 port_index, const sp<NativeHandle> &nativeHandle, buffer_id buffer); virtual status_t createInputSurface( node_id node, OMX_U32 port_index, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, Loading
media/libstagefright/include/OMXNodeInstance.h +4 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,10 @@ struct OMXNodeInstance { OMX_U32 portIndex, const sp<GraphicBuffer> &graphicBuffer, OMX::buffer_id buffer); status_t updateNativeHandleInMeta( OMX_U32 portIndex, const sp<NativeHandle> &nativeHandle, OMX::buffer_id buffer); status_t createInputSurface( OMX_U32 portIndex, android_dataspace dataSpace, sp<IGraphicBufferProducer> *bufferProducer, Loading