Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd503adb authored by Jia Meng's avatar Jia Meng
Browse files

msm: vidc: added v4l2 control to set the color of concealed MBs.



The conceal color is set to be green by default, while some users
required it to be black.
Set it to be configurable by adding this v4l2 control.

Change-Id: I37efa1e63f9927c17658a1fee8dfe48046d3a4e8
Signed-off-by: default avatarJia Meng <jmeng@codeaurora.org>
parent 5dc679da
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#define MSM_VDEC_DVC_NAME "msm_vdec_8974"
#define MIN_NUM_OUTPUT_BUFFERS 4
#define MAX_NUM_OUTPUT_BUFFERS VIDEO_MAX_FRAME
#define DEFAULT_CONCEAL_COLOR 0x0
#define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8080

#define TZ_INFO_GET_FEATURE_VERSION_ID 0x3
#define TZ_DYNAMIC_BUFFER_FEATURE_ID 12
@@ -508,6 +508,16 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = {
		.qmenu = mpeg_vidc_video_h264_mvc_layout,
		.cluster = 0,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR,
		.name = "Picture concealed color",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = 0x0,
		.maximum = 0xffffff,
		.default_value = DEFAULT_VIDEO_CONCEAL_COLOR_BLACK,
		.step = 1,
		.cluster = 0,
	},
};

#define NUM_CTRLS ARRAY_SIZE(msm_vdec_ctrls)
@@ -1548,7 +1558,6 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
{
	struct msm_vidc_inst *inst;
	int rc = 0;
	int pdata = DEFAULT_CONCEAL_COLOR;
	struct hfi_device *hdev;
	if (!q || !q->drv_priv) {
		dprintk(VIDC_ERR, "Invalid input, q = %p\n", q);
@@ -1566,10 +1575,6 @@ static int msm_vdec_start_streaming(struct vb2_queue *q, unsigned int count)
	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
		if (inst->bufq[CAPTURE_PORT].vb2_bufq.streaming)
			rc = start_streaming(inst);
		rc = call_hfi_op(hdev, session_set_property,
			(void *) inst->session,
			HAL_PARAM_VDEC_CONCEAL_COLOR,
			(void *) &pdata);
		break;
	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
		if (inst->bufq[OUTPUT_PORT].vb2_bufq.streaming)
@@ -2038,6 +2043,11 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		pdata = &layout;
		break;
	}
	case V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR:
		property_id = HAL_PARAM_VDEC_CONCEAL_COLOR;
		property_val = ctrl->val;
		pdata = &property_val;
		break;
	default:
		break;
	}
+2 −0
Original line number Diff line number Diff line
@@ -845,6 +845,8 @@ enum v4l2_mpeg_vidc_video_mvc_layout {

#define V4L2_CID_MPEG_VIDC_VIDEO_VP8_MIN_QP (V4L2_CID_MPEG_MSM_VIDC_BASE + 44)
#define V4L2_CID_MPEG_VIDC_VIDEO_VP8_MAX_QP (V4L2_CID_MPEG_MSM_VIDC_BASE + 45)
#define V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 46)

/*  Camera class control IDs */