summaryrefslogtreecommitdiff
path: root/msm8974/mm-video-v4l2
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 /msm8974/mm-video-v4l2
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 'msm8974/mm-video-v4l2')
-rw-r--r--msm8974/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp6
-rw-r--r--msm8974/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp1
-rw-r--r--msm8974/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp4
3 files changed, 10 insertions, 1 deletions
diff --git a/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
index 07eb24d..94046a1 100644
--- a/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
+++ b/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp
@@ -4294,6 +4294,9 @@ 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 = OMX_VIDEO_AVCProfileConstrainedBaseline;
+ profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
+ } else if (profileLevelType->nProfileIndex == 4) {
profileLevelType->eProfile = QOMX_VIDEO_AVCProfileConstrainedBaseline;
profileLevelType->eLevel = OMX_VIDEO_AVCLevel52;
} else {
@@ -4314,6 +4317,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/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp b/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
index ed63fb9..b63578f 100644
--- a/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
+++ b/msm8974/mm-video-v4l2/vidc/venc/src/omx_video_encoder.cpp
@@ -1702,6 +1702,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/msm8974/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/msm8974/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index 6261195..ed49aa4 100644
--- a/msm8974/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/msm8974/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -1545,6 +1545,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;
@@ -3400,7 +3401,8 @@ 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 == OMX_VIDEO_AVCProfileMain) {
requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN;