Loading include/media/IOMX.h +0 −8 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ #define ANDROID_IOMX_H_ #include <binder/IInterface.h> #include <ui/GraphicBuffer.h> #include <utils/List.h> #include <utils/String8.h> Loading Loading @@ -79,17 +78,10 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size) = 0; virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; virtual status_t useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer) = 0; virtual status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer) = 0; // This API clearly only makes sense if the caller lives in the // same process as the callee, i.e. is the media_server, as the // returned "buffer_data" pointer is just that, a pointer into local Loading include/media/stagefright/HardwareAPI.h +1 −45 Original line number Diff line number Diff line Loading @@ -25,51 +25,6 @@ #include <OMX_Component.h> namespace android { // A pointer to this struct is passed to the OMX_SetParameter when the extension // index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension // is given. // // When Android native buffer use is disabled for a port (the default state), // the OMX node should operate as normal, and expect UseBuffer calls to set its // buffers. This is the mode that will be used when CPU access to the buffer is // required. // // When Android native buffer use has been enabled, the OMX node must support // only color formats in the range [OMX_COLOR_FormatAndroidPrivateStart, // OMX_COLOR_FormatAndroidPrivateEnd). The node should then expect to receive // UseAndroidNativeBuffer calls (via OMX_SetParameter) rather than UseBuffer // calls. struct EnableAndroidNativeBuffersParams { OMX_U32 portIndex; OMX_BOOL enable; }; // Color formats in the range [OMX_COLOR_FormatAndroidPrivateStart, // OMX_COLOR_FormatAndroidPrivateEnd) will be converted to a gralloc pixel // format when used to allocate Android native buffers via gralloc. The // conversion is done by subtracting OMX_COLOR_FormatAndroidPrivateStart from // the color format reported by the codec. enum { OMX_COLOR_FormatAndroidPrivateStart = 0xA0000000, OMX_COLOR_FormatAndroidPrivateEnd = 0xB0000000, }; // A pointer to this struct is passed to OMX_SetParameter when the extension // index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is // given. This call will only be performed if a prior call was made with the // 'OMX.google.android.index.enableAndroidNativeBuffers' extension index, // enabling use of Android native buffers. struct UseAndroidNativeBufferParams { OMX_BUFFERHEADERTYPE **bufferHeader; OMX_U32 portIndex; OMX_PTR appPrivate; const sp<android_native_buffer_t>& nativeBuffer; }; } // namespace android extern android::VideoRenderer *createRenderer( const android::sp<android::ISurface> &surface, const char *componentName, Loading @@ -80,3 +35,4 @@ extern android::VideoRenderer *createRenderer( extern android::OMXPluginBase *createOMXPlugin(); #endif // HARDWARE_API_H_ media/libmedia/IOMX.cpp +0 −73 Original line number Diff line number Diff line Loading @@ -21,9 +21,7 @@ enum { SET_PARAMETER, GET_CONFIG, SET_CONFIG, ENABLE_GRAPHIC_BUFFERS, USE_BUFFER, USE_GRAPHIC_BUFFER, ALLOC_BUFFER, ALLOC_BUFFER_WITH_BACKUP, FREE_BUFFER, Loading Loading @@ -218,19 +216,6 @@ public: return reply.readInt32(); } virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); data.writeInt32(port_index); data.writeInt32((uint32_t)enable); remote()->transact(ENABLE_GRAPHIC_BUFFERS, data, &reply); status_t err = reply.readInt32(); return err; } virtual status_t useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer) { Loading @@ -253,29 +238,6 @@ public: return err; } virtual status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); data.writeInt32(port_index); data.write(*graphicBuffer); remote()->transact(USE_GRAPHIC_BUFFER, data, &reply); status_t err = reply.readInt32(); if (err != OK) { *buffer = 0; return err; } *buffer = (void*)reply.readIntPtr(); return err; } virtual status_t allocateBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data) { Loading Loading @@ -579,20 +541,6 @@ status_t BnOMX::onTransact( return NO_ERROR; } case ENABLE_GRAPHIC_BUFFERS: { CHECK_INTERFACE(IOMX, data, reply); node_id node = (void*)data.readIntPtr(); OMX_U32 port_index = data.readInt32(); OMX_BOOL enable = (OMX_BOOL)data.readInt32(); status_t err = enableGraphicBuffers(node, port_index, enable); reply->writeInt32(err); return NO_ERROR; } case USE_BUFFER: { CHECK_INTERFACE(IOMX, data, reply); Loading @@ -613,27 +561,6 @@ status_t BnOMX::onTransact( return NO_ERROR; } case USE_GRAPHIC_BUFFER: { CHECK_INTERFACE(IOMX, data, reply); node_id node = (void*)data.readIntPtr(); OMX_U32 port_index = data.readInt32(); sp<GraphicBuffer> graphicBuffer = new GraphicBuffer(); data.read(*graphicBuffer); buffer_id buffer; status_t err = useGraphicBuffer( node, port_index, graphicBuffer, &buffer); reply->writeInt32(err); if (err == OK) { reply->writeIntPtr((intptr_t)buffer); } return NO_ERROR; } case ALLOC_BUFFER: { CHECK_INTERFACE(IOMX, data, reply); Loading media/libstagefright/include/OMX.h +0 −7 Original line number Diff line number Diff line Loading @@ -59,17 +59,10 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size); virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable); virtual status_t useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer); virtual status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer); virtual status_t allocateBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data); Loading media/libstagefright/include/OMXNodeInstance.h +1 −6 Original line number Diff line number Diff line Loading @@ -49,16 +49,10 @@ 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 enableGraphicBuffers(OMX_U32 portIndex, OMX_BOOL enable); status_t useBuffer( OMX_U32 portIndex, const sp<IMemory> ¶ms, OMX::buffer_id *buffer); status_t useGraphicBuffer( OMX_U32 portIndex, const sp<GraphicBuffer> &graphicBuffer, OMX::buffer_id *buffer); status_t allocateBuffer( OMX_U32 portIndex, size_t size, OMX::buffer_id *buffer, void **buffer_data); Loading Loading @@ -131,3 +125,4 @@ private: } // namespace android #endif // OMX_NODE_INSTANCE_H_ Loading
include/media/IOMX.h +0 −8 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ #define ANDROID_IOMX_H_ #include <binder/IInterface.h> #include <ui/GraphicBuffer.h> #include <utils/List.h> #include <utils/String8.h> Loading Loading @@ -79,17 +78,10 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size) = 0; virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; virtual status_t useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer) = 0; virtual status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer) = 0; // This API clearly only makes sense if the caller lives in the // same process as the callee, i.e. is the media_server, as the // returned "buffer_data" pointer is just that, a pointer into local Loading
include/media/stagefright/HardwareAPI.h +1 −45 Original line number Diff line number Diff line Loading @@ -25,51 +25,6 @@ #include <OMX_Component.h> namespace android { // A pointer to this struct is passed to the OMX_SetParameter when the extension // index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension // is given. // // When Android native buffer use is disabled for a port (the default state), // the OMX node should operate as normal, and expect UseBuffer calls to set its // buffers. This is the mode that will be used when CPU access to the buffer is // required. // // When Android native buffer use has been enabled, the OMX node must support // only color formats in the range [OMX_COLOR_FormatAndroidPrivateStart, // OMX_COLOR_FormatAndroidPrivateEnd). The node should then expect to receive // UseAndroidNativeBuffer calls (via OMX_SetParameter) rather than UseBuffer // calls. struct EnableAndroidNativeBuffersParams { OMX_U32 portIndex; OMX_BOOL enable; }; // Color formats in the range [OMX_COLOR_FormatAndroidPrivateStart, // OMX_COLOR_FormatAndroidPrivateEnd) will be converted to a gralloc pixel // format when used to allocate Android native buffers via gralloc. The // conversion is done by subtracting OMX_COLOR_FormatAndroidPrivateStart from // the color format reported by the codec. enum { OMX_COLOR_FormatAndroidPrivateStart = 0xA0000000, OMX_COLOR_FormatAndroidPrivateEnd = 0xB0000000, }; // A pointer to this struct is passed to OMX_SetParameter when the extension // index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is // given. This call will only be performed if a prior call was made with the // 'OMX.google.android.index.enableAndroidNativeBuffers' extension index, // enabling use of Android native buffers. struct UseAndroidNativeBufferParams { OMX_BUFFERHEADERTYPE **bufferHeader; OMX_U32 portIndex; OMX_PTR appPrivate; const sp<android_native_buffer_t>& nativeBuffer; }; } // namespace android extern android::VideoRenderer *createRenderer( const android::sp<android::ISurface> &surface, const char *componentName, Loading @@ -80,3 +35,4 @@ extern android::VideoRenderer *createRenderer( extern android::OMXPluginBase *createOMXPlugin(); #endif // HARDWARE_API_H_
media/libmedia/IOMX.cpp +0 −73 Original line number Diff line number Diff line Loading @@ -21,9 +21,7 @@ enum { SET_PARAMETER, GET_CONFIG, SET_CONFIG, ENABLE_GRAPHIC_BUFFERS, USE_BUFFER, USE_GRAPHIC_BUFFER, ALLOC_BUFFER, ALLOC_BUFFER_WITH_BACKUP, FREE_BUFFER, Loading Loading @@ -218,19 +216,6 @@ public: return reply.readInt32(); } virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); data.writeInt32(port_index); data.writeInt32((uint32_t)enable); remote()->transact(ENABLE_GRAPHIC_BUFFERS, data, &reply); status_t err = reply.readInt32(); return err; } virtual status_t useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer) { Loading @@ -253,29 +238,6 @@ public: return err; } virtual status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeIntPtr((intptr_t)node); data.writeInt32(port_index); data.write(*graphicBuffer); remote()->transact(USE_GRAPHIC_BUFFER, data, &reply); status_t err = reply.readInt32(); if (err != OK) { *buffer = 0; return err; } *buffer = (void*)reply.readIntPtr(); return err; } virtual status_t allocateBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data) { Loading Loading @@ -579,20 +541,6 @@ status_t BnOMX::onTransact( return NO_ERROR; } case ENABLE_GRAPHIC_BUFFERS: { CHECK_INTERFACE(IOMX, data, reply); node_id node = (void*)data.readIntPtr(); OMX_U32 port_index = data.readInt32(); OMX_BOOL enable = (OMX_BOOL)data.readInt32(); status_t err = enableGraphicBuffers(node, port_index, enable); reply->writeInt32(err); return NO_ERROR; } case USE_BUFFER: { CHECK_INTERFACE(IOMX, data, reply); Loading @@ -613,27 +561,6 @@ status_t BnOMX::onTransact( return NO_ERROR; } case USE_GRAPHIC_BUFFER: { CHECK_INTERFACE(IOMX, data, reply); node_id node = (void*)data.readIntPtr(); OMX_U32 port_index = data.readInt32(); sp<GraphicBuffer> graphicBuffer = new GraphicBuffer(); data.read(*graphicBuffer); buffer_id buffer; status_t err = useGraphicBuffer( node, port_index, graphicBuffer, &buffer); reply->writeInt32(err); if (err == OK) { reply->writeIntPtr((intptr_t)buffer); } return NO_ERROR; } case ALLOC_BUFFER: { CHECK_INTERFACE(IOMX, data, reply); Loading
media/libstagefright/include/OMX.h +0 −7 Original line number Diff line number Diff line Loading @@ -59,17 +59,10 @@ public: node_id node, OMX_INDEXTYPE index, const void *params, size_t size); virtual status_t enableGraphicBuffers( node_id node, OMX_U32 port_index, OMX_BOOL enable); virtual status_t useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer); virtual status_t useGraphicBuffer( node_id node, OMX_U32 port_index, const sp<GraphicBuffer> &graphicBuffer, buffer_id *buffer); virtual status_t allocateBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data); Loading
media/libstagefright/include/OMXNodeInstance.h +1 −6 Original line number Diff line number Diff line Loading @@ -49,16 +49,10 @@ 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 enableGraphicBuffers(OMX_U32 portIndex, OMX_BOOL enable); status_t useBuffer( OMX_U32 portIndex, const sp<IMemory> ¶ms, OMX::buffer_id *buffer); status_t useGraphicBuffer( OMX_U32 portIndex, const sp<GraphicBuffer> &graphicBuffer, OMX::buffer_id *buffer); status_t allocateBuffer( OMX_U32 portIndex, size_t size, OMX::buffer_id *buffer, void **buffer_data); Loading Loading @@ -131,3 +125,4 @@ private: } // namespace android #endif // OMX_NODE_INSTANCE_H_