Commit d746e1ef authored by Alban Bedel's avatar Alban Bedel Committed by Nicolas Dufresne

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
parent d8fb7a9c
......@@ -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")) {
fourcc = V4L2_PIX_FMT_SBGGR8;
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")) {
......
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