media hardening: OMX::allocateBuffer must return protected buffers as native_handles
Make OMX to use native_handles for media hardening
bug: 26781087
Change-Id: Ic5746e70d71520ac7a0e90bd7accf31f11259eb4
Signed-off-by: Hyunchang Choi <[email protected]>
diff --git a/base/src/componentbase.cpp b/base/src/componentbase.cpp
old mode 100644
new mode 100755
index e0f84c3..47d9cb0
--- a/base/src/componentbase.cpp
+++ b/base/src/componentbase.cpp
@@ -874,6 +874,11 @@
return OMX_ErrorNone;
}
+ if (!strcmp(cParameterName, "OMX.google.android.index.allocateNativeHandle")) {
+ *pIndexType = static_cast<OMX_INDEXTYPE>(OMX_IndexExtAllocateNativeHandle);
+ return OMX_ErrorNone;
+ }
+
return OMX_ErrorUnsupportedIndex;
}
diff --git a/core/inc/khronos/openmax/include/OMX_IntelIndexExt.h b/core/inc/khronos/openmax/include/OMX_IntelIndexExt.h
old mode 100644
new mode 100755
index c96ccb0..9e359ac
--- a/core/inc/khronos/openmax/include/OMX_IntelIndexExt.h
+++ b/core/inc/khronos/openmax/include/OMX_IntelIndexExt.h
@@ -74,6 +74,7 @@
#ifdef TARGET_HAS_ISV
OMX_IndexExtVppBufferNum, /**<reference: vpp buffer number*/
#endif
+ OMX_IndexExtAllocateNativeHandle, /**<reference: AllocateNativeHandle */
OMX_IntelIndexExtMax = 0x7FFFFFFF
} OMX_INTELINDEXEXTTYPE;