mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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:
parent
d8fb7a9c96
commit
d746e1ef51
1 changed files with 11 additions and 1 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Reference in a new issue