diff --git a/msm/vidc/msm_vdec.c b/msm/vidc/msm_vdec.c index 37071bf5b1a8..5e2840d3999a 100644 --- a/msm/vidc/msm_vdec.c +++ b/msm/vidc/msm_vdec.c @@ -19,6 +19,52 @@ #define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8020010 #define MAX_VP9D_INST_COUNT 6 +static const char *const mpeg_video_h264_profile[] = { + "Baseline", + "Constrained Baseline", + "Main", + "Extended", + "High", + "High 10", + "High 422", + "High 444 Predictive", + "High 10 Intra", + "High 422 Intra", + "High 444 Intra", + "CAVLC 444 Intra", + "Scalable Baseline", + "Scalable High", + "Scalable High Intra", + "Stereo High", + "Multiview High", + "Constrained High", + NULL, +}; + +static const char *const mpeg_video_h264_level[] = { + "1", + "1b", + "1.1", + "1.2", + "1.3", + "2", + "2.1", + "2.2", + "3", + "3.1", + "3.2", + "4", + "4.1", + "4.2", + "5", + "5.1", + "5.2", + "6.0", + "6.1", + "6.2", + NULL, +}; + static const char *const vp8_profile_level[] = { "Unused", "0.0", @@ -134,7 +180,7 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = { (1 << V4L2_MPEG_VIDEO_H264_PROFILE_HIGH) | (1 << V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH) ), - .qmenu = NULL, + .qmenu = mpeg_video_h264_profile, }, { .id = V4L2_CID_MPEG_VIDEO_H264_LEVEL, @@ -165,7 +211,7 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = { (1 << V4L2_MPEG_VIDEO_H264_LEVEL_6_1) | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_6_2) ), - .qmenu = NULL, + .qmenu = mpeg_video_h264_level, }, { .id = V4L2_CID_MPEG_VIDEO_HEVC_PROFILE, diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index 536fd92ee82e..0720144d9cac 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -46,15 +46,61 @@ #define MIN_NUM_ENC_CAPTURE_BUFFERS 5 static const char *const mpeg_video_rate_control[] = { - "VBR CFR", - "CBR CFR", - "MBR CFR", + "VBR", + "CBR", "CBR VFR", + "MBR", "MBR VFR", "CQ", NULL }; +static const char *const mpeg_video_h264_profile[] = { + "Baseline", + "Constrained Baseline", + "Main", + "Extended", + "High", + "High 10", + "High 422", + "High 444 Predictive", + "High 10 Intra", + "High 422 Intra", + "High 444 Intra", + "CAVLC 444 Intra", + "Scalable Baseline", + "Scalable High", + "Scalable High Intra", + "Stereo High", + "Multiview High", + "Constrained High", + NULL, +}; + +static const char *const mpeg_video_h264_level[] = { + "1", + "1b", + "1.1", + "1.2", + "1.3", + "2", + "2.1", + "2.2", + "3", + "3.1", + "3.2", + "4", + "4.1", + "4.2", + "5", + "5.1", + "5.2", + "6.0", + "6.1", + "6.2", + NULL, +}; + static const char *const vp8_profile_level[] = { "Unused", "0.0", @@ -275,7 +321,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { (1 << V4L2_MPEG_VIDEO_H264_PROFILE_HIGH) | (1 << V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH) ), - .qmenu = NULL, + .qmenu = mpeg_video_h264_profile, }, { .id = V4L2_CID_MPEG_VIDEO_H264_LEVEL, @@ -306,7 +352,7 @@ static struct msm_vidc_ctrl msm_venc_ctrls[] = { (1 << V4L2_MPEG_VIDEO_H264_LEVEL_6_1) | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_6_2) ), - .qmenu = NULL, + .qmenu = mpeg_video_h264_level, }, { .id = V4L2_CID_MPEG_VIDEO_VP8_PROFILE, diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index aa0c47d323cd..e805808c611a 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -538,6 +538,25 @@ int msm_comm_get_v4l2_level(int fourcc, int level, u32 sid) } } +static bool is_priv_ctrl(u32 id) +{ + if (IS_PRIV_CTRL(id)) + return true; + + /* + * Treat below standard controls as private because + * we have added custom values to the controls + */ + switch (id) { + case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: + case V4L2_CID_MPEG_VIDEO_H264_PROFILE: + case V4L2_CID_MPEG_VIDEO_H264_LEVEL: + return true; + } + + return false; +} + int msm_comm_ctrl_init(struct msm_vidc_inst *inst, struct msm_vidc_ctrl *drv_ctrls, u32 num_ctrls, const struct v4l2_ctrl_ops *ctrl_ops) @@ -569,7 +588,7 @@ int msm_comm_ctrl_init(struct msm_vidc_inst *inst, for (; idx < (int) num_ctrls; idx++) { struct v4l2_ctrl *ctrl = NULL; - if (IS_PRIV_CTRL(drv_ctrls[idx].id)) { + if (is_priv_ctrl(drv_ctrls[idx].id)) { /*add private control*/ ctrl_cfg.def = drv_ctrls[idx].default_value; ctrl_cfg.flags = 0;