+static int ResetCrop (vlc_object_t *obj, int fd)
+{
+ struct v4l2_cropcap cropcap = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
+
+ /* In theory, this ioctl() must work for all video capture devices.
+ * In practice, it does not. */
+ if (v4l2_ioctl (fd, VIDIOC_CROPCAP, &cropcap) < 0)
+ {
+ msg_Warn (obj, "cannot get cropping properties: %m");
+ return -1;
+ }
+
+ /* Reset to the default cropping rectangle */
+ struct v4l2_crop crop = {
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ .c = cropcap.defrect,
+ };
+
+ if (v4l2_ioctl (fd, VIDIOC_S_CROP, &crop) < 0)
+ {
+ msg_Warn (obj, "cannot reset cropping limits: %m");
+ return -1;
+ }
+ return 0;
+}
+