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
commite6befb88bd2ade12c50b0a0e95b209e1f4be94b4 (patch)
treecc3592a9bba119f4378cdd75cbb6cdd1d84e3086 /include
parent8e79442c4fdabd2f82d0ed8e23d394816edee495 (diff)
downloadframeworks_base-e6befb88bd2ade12c50b0a0e95b209e1f4be94b4.zip
frameworks_base-e6befb88bd2ade12c50b0a0e95b209e1f4be94b4.tar.gz
frameworks_base-e6befb88bd2ade12c50b0a0e95b209e1f4be94b4.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();