v4l2: query crop configuration after each call of S_CROP

S_CROP ioctl is write-only and the device can adjust crop rectangle so
we query back the crop configuration after each S_CROP to know what has
been done.

https://bugzilla.gnome.org/show_bug.cgi?id=736133
This commit is contained in:
Aurélien Zanelli 2014-09-05 16:34:26 +02:00 committed by Nicolas Dufresne
parent fa283f407f
commit 88703ae585
2 changed files with 10 additions and 0 deletions

View file

@ -3135,6 +3135,11 @@ gst_v4l2_object_set_crop (GstV4l2Object * obj)
return FALSE;
}
if (v4l2_ioctl (obj->video_fd, VIDIOC_G_CROP, &crop) < 0) {
GST_WARNING_OBJECT (obj->element, "VIDIOC_G_CROP failed");
return FALSE;
}
GST_DEBUG_OBJECT (obj->element,
"Got cropping left %u, top %u, size %ux%u", crop.c.left, crop.c.top,
crop.c.width, crop.c.height);

View file

@ -321,6 +321,11 @@ gst_v4l2sink_sync_crop_fields (GstV4l2Sink * v4l2sink)
return;
}
if (v4l2_ioctl (fd, VIDIOC_G_CROP, &crop) < 0) {
GST_WARNING_OBJECT (v4l2sink, "VIDIOC_G_CROP failed");
return;
}
v4l2sink->crop_fields_set = 0;
v4l2sink->crop = crop.c;
}