diff options
author | Alban Bedel <alban.bedel@avionic-design.de> | 2016-03-08 13:03:55 +0100 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-04-07 11:41:46 -0400 |
commit | 9e1d248f523f13b2cfc21db34be12225dc733c06 (patch) | |
tree | 1e9f995499bf54a99f86059a488e6b8d277931ad | |
parent | 1a4b620175883db867cfe83a4953e4f0b72d0865 (diff) | |
download | gstreamer-plugins-good-9e1d248f523f13b2cfc21db34be12225dc733c06.tar.gz |
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
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index fc3b408d3..495526cd8 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -1573,7 +1573,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")) { |