media: Add a metadata type for native handle from camera
A payload of type kMetadataBufferTypeNativeHandleSource will
correspond to VideoNativeHandleMetadata which contains a
native_handle_t.
Bug: 26268807
Change-Id: I9805fc74c4b086b65ad57ac06385e12f255ada5b
diff --git a/include/media/hardware/HardwareAPI.h b/include/media/hardware/HardwareAPI.h
index 1008c22..b1dd062 100644
--- a/include/media/hardware/HardwareAPI.h
+++ b/include/media/hardware/HardwareAPI.h
@@ -120,6 +120,17 @@
int nFenceFd; // -1 if unused
};
+// Meta data buffer layout for passing a native_handle to codec
+struct VideoNativeHandleMetadata {
+ MetadataBufferType eType; // must be kMetadataBufferTypeNativeHandleSource
+
+#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
+ OMX_PTR pHandle;
+#else
+ native_handle_t *pHandle;
+#endif
+};
+
// A pointer to this struct is passed to OMX_SetParameter() when the extension
// index "OMX.google.android.index.prepareForAdaptivePlayback" is given.
//