v4l2: save the format correctly

If TRY_FMT is not implemented,  gst_v4l2_object_get_nearest_size will
use S_FMT and will change the device's operation mode. To save the
old device mode we need to set the type field or else it will fail
to save the previous format.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685209
This commit is contained in:
Diogo Carbonera Luvizon 2012-10-01 09:29:21 -03:00 committed by Wim Taymans
parent eac9efb92e
commit 0a7d4afc1b

View file

@ -2054,6 +2054,7 @@ gst_v4l2_object_get_nearest_size (GstV4l2Object * v4l2object,
/* Some drivers are buggy and will modify the currently set format
when processing VIDIOC_TRY_FMT, so we remember what is set at the
minute, and will reset it when done. */
prevfmt.type = v4l2object->type;
prevfmt_valid = (v4l2_ioctl (fd, VIDIOC_G_FMT, &prevfmt) >= 0);
/* get size delimiters */