示例#1
0
static int fimc_s_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_s_crop_output(fh, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE
		|| a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
		ret = fimc_s_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_s_crop_capture(ctrl, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_s_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_s_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_s_crop_capture(ctrl, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_s_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;
}