summaryrefslogtreecommitdiff
path: root/msm8998
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2017-09-06 18:19:48 -0700
committerLajos Molnar <lajos@google.com>2017-09-06 18:27:01 -0700
commit544fdbb7dbafbe83a1313564074f0af689aae752 (patch)
treed31e63684dac9c77b482145b7b8b14f78ddef667 /msm8998
parentbb2dbbd291383c57cc7420702123d81ad2e27ee8 (diff)
downloadmedia-544fdbb7dbafbe83a1313564074f0af689aae752.tar.gz
mm-video-v4l2: venc: Advertise constrained profiles for AVC encoder
Enumerate and advertise constrained profiles for AVC encoder. Inorder to have backward compatability advertise exisisting as well as newly added constants. Keep legacy constants for getters as Android media framework does not use them. Bug: 65043406 Change-Id: I6fe88a505005731c4891aa1a7c1f627c65f01861
Diffstat (limited to 'msm8998')
-rw-r--r--msm8998/mm-core/inc/OMX_VideoExt.h6
-rw-r--r--msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp6
-rw-r--r--msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp11
-rw-r--r--msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp1
-rw-r--r--msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp7
5 files changed, 27 insertions, 4 deletions
diff --git a/msm8998/mm-core/inc/OMX_VideoExt.h b/msm8998/mm-core/inc/OMX_VideoExt.h
index 79561c5..000a78c 100644
--- a/msm8998/mm-core/inc/OMX_VideoExt.h
+++ b/msm8998/mm-core/inc/OMX_VideoExt.h
@@ -58,6 +58,12 @@ typedef struct OMX_NALSTREAMFORMATTYPE{
OMX_NALUFORMATSTYPE eNaluFormat;
} OMX_NALSTREAMFORMATTYPE;
+/** AVC additional profiles */
+typedef enum OMX_VIDEO_AVCPROFILEEXTTYPE {
+ OMX_VIDEO_AVCProfileConstrainedBaseline = 0x10000, /**< Constrained baseline profile */
+ OMX_VIDEO_AVCProfileConstrainedHigh = 0x80000, /**< Constrained high profile */
+} OMX_VIDEO_AVCPROFILEEXTTYPE;
+
/** VP8 profiles */
typedef enum OMX_VIDEO_VP8PROFILETYPE {
OMX_VIDEO_VP8ProfileMain = 0x01,
diff --git a/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
index 52905d0..a973998 100644
--- a/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/msm8998/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -3606,8 +3606,12 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVEL
} else if (profileLevelType->nProfileIndex == 2) {
profileLevelType->eProfile = OMX_VIDEO_AVCProfileHigh;
} else if (profileLevelType->nProfileIndex == 3) {
- profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline;
+ profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedBaseline;
} else if (profileLevelType->nProfileIndex == 4) {
+ profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline;
+ } else if (profileLevelType->nProfileIndex == 5) {
+ profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedHigh;
+ } else if (profileLevelType->nProfileIndex == 6) {
profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedHigh;
} else {
DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %u",
diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 4493fa6..107eaee 100644
--- a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -4736,9 +4736,15 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
profileLevelType->eProfile = OMX_VIDEO_AVCProfileHigh;
profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
} else if (profileLevelType->nProfileIndex == 3) {
- profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline;
+ profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedBaseline;
profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
} else if (profileLevelType->nProfileIndex == 4) {
+ profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline;
+ profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
+ } else if (profileLevelType->nProfileIndex == 5) {
+ profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedHigh;
+ profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
+ } else if (profileLevelType->nProfileIndex == 6) {
profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedHigh;
profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
} else {
@@ -4759,6 +4765,9 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
profileLevelType->eLevel = OMX_VIDEO_AVCLevel4;
#ifdef _MSM8226_
} else if (profileLevelType->nProfileIndex == 3) {
+ profileLevelType->eProfile = OMX_VIDEO_AVCProfileConstrainedBaseline;
+ profileLevelType->eLevel = OMX_VIDEO_AVCLevel4;
+ } else if (profileLevelType->nProfileIndex == 4) {
profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline;
profileLevelType->eLevel = OMX_VIDEO_AVCLevel4;
#endif
diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index 2f26281..b8ee093 100644
--- a/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/msm8998/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -1989,6 +1989,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
} else {
m_sParamAVC.nPFrames = pParam->nPFrames;
if ((m_sParamAVC.eProfile != OMX_VIDEO_AVCProfileBaseline) &&
+ (m_sParamAVC.eProfile != (OMX_VIDEO_AVCPROFILETYPE) OMX_VIDEO_AVCProfileConstrainedBaseline) &&
(m_sParamAVC.eProfile != (OMX_VIDEO_AVCPROFILETYPE) QOMX_VIDEO_AVCProfileConstrainedBaseline))
m_sParamAVC.nBFrames = pParam->nBFrames;
else
diff --git a/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index 49797ca..0bdd914 100644
--- a/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/msm8998/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -2087,6 +2087,7 @@ bool venc_dev::venc_set_param(void *paramData, OMX_INDEXTYPE index)
return false;
} else {
if ((pParam->eProfile != OMX_VIDEO_AVCProfileBaseline) &&
+ (pParam->eProfile != (OMX_VIDEO_AVCPROFILETYPE) OMX_VIDEO_AVCProfileConstrainedBaseline) &&
(pParam->eProfile != (OMX_VIDEO_AVCPROFILETYPE) QOMX_VIDEO_AVCProfileConstrainedBaseline)) {
if (pParam->nBFrames) {
bFrames = pParam->nBFrames;
@@ -5136,9 +5137,11 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
} else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) {
if (eProfile == OMX_VIDEO_AVCProfileBaseline) {
requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE;
- } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedBaseline) {
+ } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedBaseline ||
+ eProfile == OMX_VIDEO_AVCProfileConstrainedBaseline) {
requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE;
- } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedHigh) {
+ } else if(eProfile == QOMX_VIDEO_AVCProfileConstrainedHigh ||
+ eProfile == OMX_VIDEO_AVCProfileConstrainedHigh) {
requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH;
} else if (eProfile == OMX_VIDEO_AVCProfileMain) {
requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN;