diff options
author | Jamie Gennis <jgennis@google.com> | 2010-08-30 16:48:38 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2010-09-03 14:32:42 -0700 |
commit | 83750eaf5a3f38c243a9e7eb81d4b2421e3a0d88 (patch) | |
tree | 3e986eeeff4dd2f5d7cb9ddb3c90a714be495f2e /include/media/stagefright/HardwareAPI.h | |
parent | 9f2d258645826c999a93a4206df157fec2e3b0f2 (diff) | |
download | frameworks_av-83750eaf5a3f38c243a9e7eb81d4b2421e3a0d88.zip frameworks_av-83750eaf5a3f38c243a9e7eb81d4b2421e3a0d88.tar.gz frameworks_av-83750eaf5a3f38c243a9e7eb81d4b2421e3a0d88.tar.bz2 |
Add the new Stagefright ANativeWindow OMX codec API.
This change defines the two OMX_SetParameter calls that enable OMX codecs to
interact with ANativeWindows. It also adds the plumbing to the IOMX, OMX, and
OMXNodeInstance classes to use these new APIs.
This is try 2 for this change, after reverting the first one because it broke
the build.
Change-Id: I94249b72bdb5d5719360f03d7935fcca4ece5028
Diffstat (limited to 'include/media/stagefright/HardwareAPI.h')
-rw-r--r-- | include/media/stagefright/HardwareAPI.h | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/include/media/stagefright/HardwareAPI.h b/include/media/stagefright/HardwareAPI.h index 221c679..4ded5e8 100644 --- a/include/media/stagefright/HardwareAPI.h +++ b/include/media/stagefright/HardwareAPI.h @@ -21,10 +21,60 @@ #include <media/stagefright/OMXPluginBase.h> #include <media/stagefright/VideoRenderer.h> #include <surfaceflinger/ISurface.h> +#include <ui/android_native_buffer.h> #include <utils/RefBase.h> #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 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + 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_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_PTR pAppPrivate; + OMX_BUFFERHEADERTYPE **bufferHeader; + const sp<android_native_buffer_t>& nativeBuffer; +}; + +} // namespace android + extern android::VideoRenderer *createRenderer( const android::sp<android::ISurface> &surface, const char *componentName, @@ -35,4 +85,3 @@ extern android::VideoRenderer *createRenderer( extern android::OMXPluginBase *createOMXPlugin(); #endif // HARDWARE_API_H_ - |