diff options
author | Lajos Molnar <lajos@google.com> | 2017-09-06 18:19:48 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2017-09-06 18:27:01 -0700 |
commit | 544fdbb7dbafbe83a1313564074f0af689aae752 (patch) | |
tree | d31e63684dac9c77b482145b7b8b14f78ddef667 /msm8996 | |
parent | bb2dbbd291383c57cc7420702123d81ad2e27ee8 (diff) | |
download | media-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 'msm8996')
4 files changed, 22 insertions, 3 deletions
diff --git a/msm8996/mm-core/inc/OMX_VideoExt.h b/msm8996/mm-core/inc/OMX_VideoExt.h index 59258d7..9c01495 100644 --- a/msm8996/mm-core/inc/OMX_VideoExt.h +++ b/msm8996/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/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp index 64f76ee..6175da0 100644 --- a/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -4602,9 +4602,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 { @@ -4625,6 +4631,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/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp index f4a92a4..9faf8c2 100644 --- a/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp +++ b/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp @@ -1864,6 +1864,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/msm8996/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/msm8996/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp index 03652aa..4250d8e 100644 --- a/msm8996/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp +++ b/msm8996/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp @@ -1859,6 +1859,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; @@ -4546,9 +4547,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; |