コード例 #1
0
static int fimc_g_crop(struct file *filp, void *fh, struct v4l2_crop *a)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	int ret = -1;

#ifdef CONFIG_SLP_DMABUF
	if (V4L2_TYPE_IS_OUTPUT(a->type)) {
		ret = fimc_g_crop_output(fh, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE
		|| a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
		ret = fimc_g_crop_capture(ctrl, a);
	} else {
		fimc_err("V4L2_BUF_TYPE_VIDEO_CAPTURE and "
			"V4L2_BUF_TYPE_VIDEO_OUTPUT are only supported\n");
		ret = -EINVAL;
	}
#else
	if (a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
		ret = fimc_g_crop_capture(ctrl, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_g_crop_output(fh, a);
	} else {
		fimc_err("V4L2_BUF_TYPE_VIDEO_CAPTURE and "
			"V4L2_BUF_TYPE_VIDEO_OUTPUT are only supported\n");
		ret = -EINVAL;
	}
#endif

	return ret;
}
コード例 #2
0
static int fimc_g_crop(struct file *filp, void *fh, struct v4l2_crop *a)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	int ret = -1;

	if (a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
		ret = fimc_g_crop_capture(ctrl, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_g_crop_output(fh, a);
	} else {
		fimc_err("V4L2_BUF_TYPE_VIDEO_CAPTURE and "
			"V4L2_BUF_TYPE_VIDEO_OUTPUT are only supported\n");
		ret = -EINVAL;
	}

	return ret;
}