Commit dbaca549 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

v4l2object: Read driver selected interlace mode

If there was no interlace-mode field in the caps. Read back the value
selected by the driver. This way, if the driver does not support
progressive, then it will automatically negotiate the returned mode
unless this mode is not supported by GStreamer.

This method was already used for colorimetry. Just like colorimetry, the
interlace mode is not longer probed by v4l2src dues to performance

Fixes #511
parent 40fc8aea
......@@ -3583,13 +3583,18 @@ gst_v4l2_object_set_format_full (GstV4l2Object * v4l2object, GstCaps * caps,
if (is_mplane && format.fmt.pix_mp.num_planes != n_v4l_planes)
goto invalid_planes;
if ((is_mplane && format.fmt.pix_mp.field != field)
|| format.fmt.pix.field != field)
/* used to check colorimetry and interlace mode fields presence */
s = gst_caps_get_structure (caps, 0);
if (!gst_v4l2_object_get_interlace_mode (format.fmt.pix.field,
goto invalid_field;
if (gst_structure_has_field (s, "interlace-mode")) {
if (format.fmt.pix.field != field)
goto invalid_field;
gst_v4l2_object_get_colorspace (&format, &info.colorimetry);
s = gst_caps_get_structure (caps, 0);
if (gst_structure_has_field (s, "colorimetry")) {
if (!gst_v4l2_video_colorimetry_matches (&info.colorimetry,
gst_structure_get_string (s, "colorimetry")))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment