|
@@ -1018,26 +1018,37 @@ static int uvc_ioctl_querymenu(struct file *file, void *fh,
|
|
return uvc_query_v4l2_menu(chain, qm);
|
|
return uvc_query_v4l2_menu(chain, qm);
|
|
}
|
|
}
|
|
|
|
|
|
-static int uvc_ioctl_cropcap(struct file *file, void *fh,
|
|
|
|
- struct v4l2_cropcap *ccap)
|
|
|
|
|
|
+static int uvc_ioctl_g_selection(struct file *file, void *fh,
|
|
|
|
+ struct v4l2_selection *sel)
|
|
{
|
|
{
|
|
struct uvc_fh *handle = fh;
|
|
struct uvc_fh *handle = fh;
|
|
struct uvc_streaming *stream = handle->stream;
|
|
struct uvc_streaming *stream = handle->stream;
|
|
|
|
|
|
- if (ccap->type != stream->type)
|
|
|
|
|
|
+ if (sel->type != stream->type)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- ccap->bounds.left = 0;
|
|
|
|
- ccap->bounds.top = 0;
|
|
|
|
|
|
+ switch (sel->target) {
|
|
|
|
+ case V4L2_SEL_TGT_CROP_DEFAULT:
|
|
|
|
+ case V4L2_SEL_TGT_CROP_BOUNDS:
|
|
|
|
+ if (stream->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ break;
|
|
|
|
+ case V4L2_SEL_TGT_COMPOSE_DEFAULT:
|
|
|
|
+ case V4L2_SEL_TGT_COMPOSE_BOUNDS:
|
|
|
|
+ if (stream->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sel->r.left = 0;
|
|
|
|
+ sel->r.top = 0;
|
|
mutex_lock(&stream->mutex);
|
|
mutex_lock(&stream->mutex);
|
|
- ccap->bounds.width = stream->cur_frame->wWidth;
|
|
|
|
- ccap->bounds.height = stream->cur_frame->wHeight;
|
|
|
|
|
|
+ sel->r.width = stream->cur_frame->wWidth;
|
|
|
|
+ sel->r.height = stream->cur_frame->wHeight;
|
|
mutex_unlock(&stream->mutex);
|
|
mutex_unlock(&stream->mutex);
|
|
|
|
|
|
- ccap->defrect = ccap->bounds;
|
|
|
|
-
|
|
|
|
- ccap->pixelaspect.numerator = 1;
|
|
|
|
- ccap->pixelaspect.denominator = 1;
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1452,7 +1463,7 @@ const struct v4l2_ioctl_ops uvc_ioctl_ops = {
|
|
.vidioc_s_ext_ctrls = uvc_ioctl_s_ext_ctrls,
|
|
.vidioc_s_ext_ctrls = uvc_ioctl_s_ext_ctrls,
|
|
.vidioc_try_ext_ctrls = uvc_ioctl_try_ext_ctrls,
|
|
.vidioc_try_ext_ctrls = uvc_ioctl_try_ext_ctrls,
|
|
.vidioc_querymenu = uvc_ioctl_querymenu,
|
|
.vidioc_querymenu = uvc_ioctl_querymenu,
|
|
- .vidioc_cropcap = uvc_ioctl_cropcap,
|
|
|
|
|
|
+ .vidioc_g_selection = uvc_ioctl_g_selection,
|
|
.vidioc_g_parm = uvc_ioctl_g_parm,
|
|
.vidioc_g_parm = uvc_ioctl_g_parm,
|
|
.vidioc_s_parm = uvc_ioctl_s_parm,
|
|
.vidioc_s_parm = uvc_ioctl_s_parm,
|
|
.vidioc_enum_framesizes = uvc_ioctl_enum_framesizes,
|
|
.vidioc_enum_framesizes = uvc_ioctl_enum_framesizes,
|