Ejemplo n.º 1
0
static int fimc_cropcap(struct file *filp, void *fh, struct v4l2_cropcap *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_cropcap_output(fh, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE
		|| a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
		ret = fimc_cropcap_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_cropcap_capture(ctrl, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_cropcap_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;
}
Ejemplo n.º 2
0
static int fimc_cropcap(struct file *filp, void *fh, struct v4l2_cropcap *a)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	int ret = -1;

	if (a->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
		ret = fimc_cropcap_capture(ctrl, a);
	} else if (a->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_cropcap_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;
}