summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-02-23 19:01:28 -0800
committerJamie Gennis <jgennis@google.com>2011-02-28 12:12:20 -0800
commite2ce6458659c6e1bad420357b61dc10cd8bbe2ab (patch)
tree89a59a1cef847dc359dbf013f0c76d94f6363918 /include
parent3911a720270fc0326accfa4a3df427a649a45487 (diff)
downloadframeworks_av-e2ce6458659c6e1bad420357b61dc10cd8bbe2ab.zip
frameworks_av-e2ce6458659c6e1bad420357b61dc10cd8bbe2ab.tar.gz
frameworks_av-e2ce6458659c6e1bad420357b61dc10cd8bbe2ab.tar.bz2
Add an OMX IL API for querying buffer usage flags.
This change defines an OpenMAX IL API for querying from the IL component the gralloc buffer usage flags that should be used to allocate the buffers. It also adds the Stagefright plumbing for using the new OMX IL API. Change-Id: I046b5e7be70ce61e2a921dcdc6e3aa9324d19ea6 Related-Bug: 3479027
Diffstat (limited to 'include')
-rw-r--r--include/media/IOMX.h3
-rw-r--r--include/media/stagefright/HardwareAPI.h12
2 files changed, 15 insertions, 0 deletions
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index cb36bbb..16a9342 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -85,6 +85,9 @@ public:
virtual status_t enableGraphicBuffers(
node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0;
+ virtual status_t getGraphicBufferUsage(
+ node_id node, OMX_U32 port_index, OMX_U32* usage) = 0;
+
virtual status_t useBuffer(
node_id node, OMX_U32 port_index, const sp<IMemory> &params,
buffer_id *buffer) = 0;
diff --git a/include/media/stagefright/HardwareAPI.h b/include/media/stagefright/HardwareAPI.h
index 17908b4..d1ecaaf 100644
--- a/include/media/stagefright/HardwareAPI.h
+++ b/include/media/stagefright/HardwareAPI.h
@@ -87,6 +87,18 @@ struct UseAndroidNativeBufferParams {
const sp<android_native_buffer_t>& nativeBuffer;
};
+// A pointer to this struct is passed to OMX_GetParameter when the extension
+// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage'
+// extension is given. The usage bits returned from this query will be used to
+// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer
+// command.
+struct GetAndroidNativeBufferUsageParams {
+ OMX_U32 nSize; // IN
+ OMX_VERSIONTYPE nVersion; // IN
+ OMX_U32 nPortIndex; // IN
+ OMX_U32 nUsage; // OUT
+};
+
} // namespace android
extern android::OMXPluginBase *createOMXPlugin();