summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPraveen Chavan <pchavan@codeaurora.org>2014-07-10 18:10:51 -0700
committerVineeta Srivastava <vsrivastava@google.com>2014-12-10 23:40:49 +0000
commit5aa03230fef7a43a61e1ac5f19a2c5a71e5d6df7 (patch)
treed00a2500a8735d92a131c6af80feb5352f2c9e45
parentbd2ac6fe23ddf0dd3afda51242441353a036faf9 (diff)
downloadandroid_hardware_qcom_media-5aa03230fef7a43a61e1ac5f19a2c5a71e5d6df7.tar.gz
android_hardware_qcom_media-5aa03230fef7a43a61e1ac5f19a2c5a71e5d6df7.tar.bz2
android_hardware_qcom_media-5aa03230fef7a43a61e1ac5f19a2c5a71e5d6df7.zip
mm-core: synchronize OpenMax headers with AOSP counterparts
Update the video headers, retaining the enhancements. Also use standard coding types (like VP8 instead of VPX) and map the extended codec-types to standard types wherever applicable. Update HEVC profile/level enumeration values to follow the spec nomenclature. Bug: 18364450 Change-Id: I6642050e9b3c331df26c997c1d2276576cb62e93
-rw-r--r--mm-core/inc/OMX_IVCommon.h13
-rw-r--r--mm-core/inc/OMX_IndexExt.h17
-rwxr-xr-xmm-core/inc/OMX_QCOMExtns.h4
-rwxr-xr-xmm-core/inc/OMX_Video.h5
-rw-r--r--mm-core/inc/OMX_VideoExt.h56
-rwxr-xr-xmm-video-v4l2/vidc/vdec/src/omx_vdec_hevc.cpp2
-rwxr-xr-xmm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp2
-rwxr-xr-xmm-video-v4l2/vidc/venc/src/omx_video_base.cpp2
-rwxr-xr-xmm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp12
-rwxr-xr-xmm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp6
10 files changed, 91 insertions, 28 deletions
diff --git a/mm-core/inc/OMX_IVCommon.h b/mm-core/inc/OMX_IVCommon.h
index 37763ec0..3b1a842c 100644
--- a/mm-core/inc/OMX_IVCommon.h
+++ b/mm-core/inc/OMX_IVCommon.h
@@ -132,6 +132,19 @@ typedef enum OMX_COLOR_FORMATTYPE {
OMX_COLOR_Format24BitABGR6666,
OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ /**<Reserved android opaque colorformat. Tells the encoder that
+ * the actual colorformat will be relayed by the
+ * Gralloc Buffers.
+ * FIXME: In the process of reserving some enum values for
+ * Android-specific OMX IL colorformats. Change this enum to
+ * an acceptable range once that is done.
+ * */
+ OMX_COLOR_FormatAndroidOpaque = 0x7F000789,
+ OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100,
+ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
+ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
+ OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002,
+ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m = 0x7FA30C04,
OMX_COLOR_FormatMax = 0x7FFFFFFF
} OMX_COLOR_FORMATTYPE;
diff --git a/mm-core/inc/OMX_IndexExt.h b/mm-core/inc/OMX_IndexExt.h
index 100a33c8..007165bb 100644
--- a/mm-core/inc/OMX_IndexExt.h
+++ b/mm-core/inc/OMX_IndexExt.h
@@ -49,6 +49,8 @@ typedef enum OMX_INDEXEXTTYPE {
/* Component parameters and configurations */
OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000,
OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */
+ OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */
+ OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */
/* Port parameters and configurations */
OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000,
@@ -61,12 +63,15 @@ typedef enum OMX_INDEXEXTTYPE {
/* Video parameters and configurations */
OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000,
- OMX_IndexKhronosExtParamNALStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
- OMX_IndexKhronosExtParamNALStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
- OMX_IndexKhronosExtParamNALStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */
- OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */
- OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */
- OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */
+ OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */
+ OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */
+ OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */
+ OMX_IndexParamVideoAndroidVp8Encoder, /**< reference: OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE */
+ OMX_IndexParamVideoHevc, /**< reference: OMX_VIDEO_PARAM_HEVCTYPE */
+ OMX_IndexParamSliceSegments, /**< reference: OMX_VIDEO_SLICESEGMENTSTYPE */
/* Image & Video common configurations */
OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000,
diff --git a/mm-core/inc/OMX_QCOMExtns.h b/mm-core/inc/OMX_QCOMExtns.h
index fff70937..a5676bf6 100755
--- a/mm-core/inc/OMX_QCOMExtns.h
+++ b/mm-core/inc/OMX_QCOMExtns.h
@@ -290,8 +290,8 @@ enum OMX_QCOM_VIDEO_CODINGTYPE
QOMX_VIDEO_CodingDivx = 0x7FA30C02, /**< Value when coding is Divx */
QOMX_VIDEO_CodingSpark = 0x7FA30C03, /**< Value when coding is Sorenson Spark */
QOMX_VIDEO_CodingVp = 0x7FA30C04,
- QOMX_VIDEO_CodingVp8 = 0x7FA30C05,
- QOMX_VIDEO_CodingHevc = 0x7FA30C06,
+ QOMX_VIDEO_CodingVp8 = OMX_VIDEO_CodingVP8, /**< keeping old enum for backwards compatibility*/
+ QOMX_VIDEO_CodingHevc = OMX_VIDEO_CodingHEVC, /**< keeping old enum for backwards compatibility*/
QOMX_VIDEO_CodingMVC = 0x7FA30C07,
};
diff --git a/mm-core/inc/OMX_Video.h b/mm-core/inc/OMX_Video.h
index 75757e3f..16f5b0c4 100755
--- a/mm-core/inc/OMX_Video.h
+++ b/mm-core/inc/OMX_Video.h
@@ -68,7 +68,9 @@ typedef enum OMX_VIDEO_CODINGTYPE {
OMX_VIDEO_CodingRV, /**< all versions of Real Video */
OMX_VIDEO_CodingAVC, /**< H.264/AVC */
OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */
- OMX_VIDEO_CodingVPX, /**< Google VPX, formerly known as On2 VP8 */
+ OMX_VIDEO_CodingVP8, /**< Google VP8, formerly known as On2 VP8 */
+ OMX_VIDEO_CodingVP9, /**< Google VP9 */
+ OMX_VIDEO_CodingHEVC, /**< HEVC */
OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
OMX_VIDEO_CodingMax = 0x7FFFFFFF
@@ -294,6 +296,7 @@ typedef enum OMX_VIDEO_INTRAREFRESHTYPE {
OMX_VIDEO_IntraRefreshBoth,
OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_IntraRefreshRandom,
OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF
} OMX_VIDEO_INTRAREFRESHTYPE;
diff --git a/mm-core/inc/OMX_VideoExt.h b/mm-core/inc/OMX_VideoExt.h
index d2c52026..5bf6fd48 100644
--- a/mm-core/inc/OMX_VideoExt.h
+++ b/mm-core/inc/OMX_VideoExt.h
@@ -39,7 +39,6 @@ extern "C" {
* for this header file to compile successfully
*/
#include <OMX_Core.h>
-#include <OMX_Video.h>
/** NALU Formats */
typedef enum OMX_NALUFORMATSTYPE {
@@ -59,12 +58,6 @@ typedef struct OMX_NALSTREAMFORMATTYPE{
OMX_NALUFORMATSTYPE eNaluFormat;
} OMX_NALSTREAMFORMATTYPE;
-/** Enum for standard video codingtype extensions */
-typedef enum OMX_VIDEO_CODINGEXTTYPE {
- OMX_VIDEO_ExtCodingUnused = OMX_VIDEO_CodingKhronosExtensions,
- OMX_VIDEO_CodingVP8, /**< VP8/WebM */
-} OMX_VIDEO_CODINGEXTTYPE;
-
/** VP8 profiles */
typedef enum OMX_VIDEO_VP8PROFILETYPE {
OMX_VIDEO_VP8ProfileMain = 0x01,
@@ -115,6 +108,55 @@ typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE {
OMX_BOOL bIsGoldenOrAlternateFrame;
} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE;
+/** HEVC Profiles */
+typedef enum OMX_VIDEO_HEVCPROFILETYPE {
+ OMX_VIDEO_HEVCProfileMain = 0x01,
+ OMX_VIDEO_HEVCProfileMain10 = 0x02,
+ OMX_VIDEO_HEVCProfileUnknown = 0x6EFFFFFF,
+ OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_HEVCPROFILETYPE;
+
+/** HEVC levels */
+typedef enum OMX_VIDEO_HEVCLEVELTYPE {
+ OMX_VIDEO_HEVCLevel_Version0 = 0x0,
+ OMX_VIDEO_HEVCMainTierLevel1 = 0x1,
+ OMX_VIDEO_HEVCHighTierLevel1 = 0x2,
+ OMX_VIDEO_HEVCMainTierLevel2 = 0x4,
+ OMX_VIDEO_HEVCHighTierLevel2 = 0x8,
+ OMX_VIDEO_HEVCMainTierLevel21 = 0x10,
+ OMX_VIDEO_HEVCHighTierLevel21 = 0x20,
+ OMX_VIDEO_HEVCMainTierLevel3 = 0x40,
+ OMX_VIDEO_HEVCHighTierLevel3 = 0x80,
+ OMX_VIDEO_HEVCMainTierLevel31 = 0x100,
+ OMX_VIDEO_HEVCHighTierLevel31 = 0x200,
+ OMX_VIDEO_HEVCMainTierLevel4 = 0x400,
+ OMX_VIDEO_HEVCHighTierLevel4 = 0x800,
+ OMX_VIDEO_HEVCMainTierLevel41 = 0x1000,
+ OMX_VIDEO_HEVCHighTierLevel41 = 0x2000,
+ OMX_VIDEO_HEVCMainTierLevel5 = 0x4000,
+ OMX_VIDEO_HEVCHighTierLevel5 = 0x8000,
+ OMX_VIDEO_HEVCMainTierLevel51 = 0x10000,
+ OMX_VIDEO_HEVCHighTierLevel51 = 0x20000,
+ OMX_VIDEO_HEVCMainTierLevel52 = 0x40000,
+ OMX_VIDEO_HEVCHighTierLevel52 = 0x80000,
+ OMX_VIDEO_HEVCMainTierLevel6 = 0x100000,
+ OMX_VIDEO_HEVCHighTierLevel6 = 0x200000,
+ OMX_VIDEO_HEVCMainTierLevel61 = 0x400000,
+ OMX_VIDEO_HEVCHighTierLevel61 = 0x800000,
+ OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000,
+ OMX_VIDEO_HEVCLevelUnknown = 0x6EFFFFFF,
+ OMX_VIDEO_HEVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_HEVCLEVELTYPE;
+
+/** HEVC Param */
+typedef struct OMX_VIDEO_PARAM_HEVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_HEVCPROFILETYPE eProfile;
+ OMX_VIDEO_HEVCLEVELTYPE eLevel;
+} OMX_VIDEO_PARAM_HEVCTYPE;
+
#ifdef __cplusplus
}
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_hevc.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_hevc.cpp
index 3cdc76df..2811e3bb 100755
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_hevc.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_hevc.cpp
@@ -1418,7 +1418,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_MAX_STRINGNAME_SIZE)) {
strlcpy((char *)m_cRole, "video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE);
output_capability=V4L2_PIX_FMT_VP8;
- eCompressionFormat = OMX_VIDEO_CodingVPX;
+ eCompressionFormat = OMX_VIDEO_CodingVP8;
codec_type_parse = CODEC_TYPE_VP8;
arbitrary_bytes = false;
} else {
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
index 2fbdff88..dc2d97ac 100755
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp
@@ -1667,7 +1667,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_MAX_STRINGNAME_SIZE)) {
strlcpy((char *)m_cRole, "video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE);
output_capability=V4L2_PIX_FMT_VP8;
- eCompressionFormat = OMX_VIDEO_CodingVPX;
+ eCompressionFormat = OMX_VIDEO_CodingVP8;
codec_type_parse = CODEC_TYPE_VP8;
arbitrary_bytes = false;
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 179d6300..0cf76d97 100755
--- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -4187,7 +4187,7 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %u", (unsigned int)profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
- } else if (m_sOutPortDef.format.video.eCompressionFormat == OMX_VIDEO_CodingVPX) {
+ } else if (m_sOutPortDef.format.video.eCompressionFormat == OMX_VIDEO_CodingVP8) {
if (profileLevelType->nProfileIndex == 0) {
profileLevelType->eProfile = OMX_VIDEO_VP8ProfileMain;
profileLevelType->eLevel = OMX_VIDEO_VP8Level_Version0;
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index b5566b80..3ec43614 100755
--- a/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -146,7 +146,7 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
else if (!strncmp((char *)m_nkind, "OMX.qcom.video.encoder.vp8", \
OMX_MAX_STRINGNAME_SIZE)) {
strlcpy((char *)m_cRole, "video_encoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- codec_type = OMX_VIDEO_CodingVPX;
+ codec_type = OMX_VIDEO_CodingVP8;
}
#endif
else {
@@ -258,7 +258,7 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
} else if (codec_type == OMX_VIDEO_CodingAVC) {
m_sParamProfileLevel.eProfile = (OMX_U32) OMX_VIDEO_AVCProfileBaseline;
m_sParamProfileLevel.eLevel = (OMX_U32) OMX_VIDEO_AVCLevel1;
- } else if (codec_type == OMX_VIDEO_CodingVPX) {
+ } else if (codec_type == OMX_VIDEO_CodingVP8) {
m_sParamProfileLevel.eProfile = (OMX_U32) OMX_VIDEO_VP8ProfileMain;
m_sParamProfileLevel.eLevel = (OMX_U32) OMX_VIDEO_VP8Level_Version0;
}
@@ -307,8 +307,8 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
m_sOutPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingH263;
} else if (codec_type == OMX_VIDEO_CodingAVC) {
m_sOutPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;
- } else if (codec_type == OMX_VIDEO_CodingVPX) {
- m_sOutPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingVPX;
+ } else if (codec_type == OMX_VIDEO_CodingVP8) {
+ m_sOutPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingVP8;
}
if (dev_get_buf_req(&m_sOutPortDef.nBufferCountMin,
@@ -338,8 +338,8 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
m_sOutPortFormat.eCompressionFormat = OMX_VIDEO_CodingH263;
} else if (codec_type == OMX_VIDEO_CodingAVC) {
m_sOutPortFormat.eCompressionFormat = OMX_VIDEO_CodingAVC;
- } else if (codec_type == OMX_VIDEO_CodingVPX) {
- m_sOutPortFormat.eCompressionFormat = OMX_VIDEO_CodingVPX;
+ } else if (codec_type == OMX_VIDEO_CodingVP8) {
+ m_sOutPortFormat.eCompressionFormat = OMX_VIDEO_CodingVP8;
}
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index 83949eea..976498f7 100755
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -812,7 +812,7 @@ bool venc_dev::venc_open(OMX_U32 codec)
profile_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_0;
session_qp_range.minqp = 1;
session_qp_range.maxqp = 51;
- } else if (codec == OMX_VIDEO_CodingVPX) {
+ } else if (codec == OMX_VIDEO_CodingVP8) {
m_sVenc_cfg.codectype = V4L2_PIX_FMT_VP8;
codec_profile.profile = V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED;
profile_level.level = V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0;
@@ -1475,7 +1475,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
// For VP8, hier-p and ltr are mutually exclusive features in firmware
// Disable hier-p if ltr is enabled.
- if (m_codec == OMX_VIDEO_CodingVPX) {
+ if (m_codec == OMX_VIDEO_CodingVP8) {
DEBUG_PRINT_LOW("Disable Hier-P as LTR is being set");
if (!venc_set_hier_layers(QOMX_HIERARCHICALCODING_P, 0)) {
DEBUG_PRINT_ERROR("Disabling Hier P count failed");
@@ -1680,7 +1680,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
// For VP8, hier-p and ltr are mutually exclusive features in firmware
// Disable ltr if hier-p is enabled.
- if (m_codec == OMX_VIDEO_CodingVPX) {
+ if (m_codec == OMX_VIDEO_CodingVP8) {
DEBUG_PRINT_LOW("Disable LTR as HIER-P is being set");
if(!venc_set_ltrmode(0, 1)) {
DEBUG_PRINT_ERROR("ERROR: Failed to disable ltrmode");