HardwareAPI: set enum basetypes for MediaImage2
- also add some internal methods for cleaner usage of these
types
Bug: 25684127
Change-Id: I151270b015ba5989212926e946e04edb7ee8494d
diff --git a/include/media/hardware/HardwareAPI.h b/include/media/hardware/HardwareAPI.h
index 752b004..feec509 100644
--- a/include/media/hardware/HardwareAPI.h
+++ b/include/media/hardware/HardwareAPI.h
@@ -258,7 +258,7 @@
};
struct MediaImage2 {
- enum Type {
+ enum Type : uint32_t {
MEDIA_IMAGE_TYPE_UNKNOWN = 0,
MEDIA_IMAGE_TYPE_YUV,
MEDIA_IMAGE_TYPE_YUVA,
@@ -267,7 +267,7 @@
MEDIA_IMAGE_TYPE_Y,
};
- enum PlaneIndex {
+ enum PlaneIndex : uint32_t {
Y = 0,
U = 1,
V = 2,
@@ -294,6 +294,8 @@
uint32_t mVertSubsampling; // subsampling compared to the largest plane
};
PlaneInfo mPlane[MAX_NUM_PLANES];
+
+ void initFromV1(const MediaImage&); // for internal use only
};
// A pointer to this struct is passed to OMX_GetParameter when the extension
@@ -324,6 +326,7 @@
// buffers, the component shall set mNumPlanes to 0, and mType to MEDIA_IMAGE_TYPE_UNKNOWN.
// @deprecated: use DescribeColorFormat2Params
+struct DescribeColorFormat2Params;
struct DescribeColorFormatParams {
OMX_U32 nSize;
OMX_VERSIONTYPE nVersion;
@@ -337,6 +340,8 @@
// output: fill out the MediaImage fields
MediaImage sMediaImage;
+
+ DescribeColorFormatParams(const DescribeColorFormat2Params&); // for internal use only
};
// A pointer to this struct is passed to OMX_GetParameter when the extension
@@ -356,6 +361,8 @@
// output: fill out the MediaImage2 fields
MediaImage2 sMediaImage;
+
+ void initFromV1(const DescribeColorFormatParams&); // for internal use only
};
// A pointer to this struct is passed to OMX_SetParameter or OMX_GetParameter