v4l2object: fix capture with bayer formats other than bggr

gst_v4l2_object_get_caps_info() always return V4L2_PIX_FMT_SBGGR8
for all bayer formats. This is obviously broken if the device use
another ordering. Fix this by properly reading the format parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=763318
This commit is contained in:
Alban Bedel 2016-03-08 13:03:55 +01:00 committed by Nicolas Dufresne
parent d8fb7a9c96
commit d746e1ef51

View file

@ -1736,7 +1736,17 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
} else if (g_str_equal (mimetype, "video/x-vp8")) {
fourcc = V4L2_PIX_FMT_VP8;
} else if (g_str_equal (mimetype, "video/x-bayer")) {
const gchar *format = gst_structure_get_string (structure, "format");
if (format) {
if (!g_ascii_strcasecmp (format, "bggr"))
fourcc = V4L2_PIX_FMT_SBGGR8;
else if (!g_ascii_strcasecmp (format, "gbrg"))
fourcc = V4L2_PIX_FMT_SGBRG8;
else if (!g_ascii_strcasecmp (format, "grbg"))
fourcc = V4L2_PIX_FMT_SGRBG8;
else if (!g_ascii_strcasecmp (format, "rggb"))
fourcc = V4L2_PIX_FMT_SRGGB8;
}
} else if (g_str_equal (mimetype, "video/x-sonix")) {
fourcc = V4L2_PIX_FMT_SN9C10X;
} else if (g_str_equal (mimetype, "video/x-pwc1")) {