Commit 2676ac90 authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2transform: Expose BGRA and ARGB formats

parent 10b67e99
...@@ -82,8 +82,26 @@ gst_v4l2_probe_template_caps (const gchar * device, gint video_fd, ...@@ -82,8 +82,26 @@ gst_v4l2_probe_template_caps (const gchar * device, gint video_fd,
template = gst_v4l2_object_v4l2fourcc_to_structure (format.pixelformat); template = gst_v4l2_object_v4l2fourcc_to_structure (format.pixelformat);
if (template) if (template) {
GstStructure *alt_t = NULL;
switch (format.pixelformat) {
case V4L2_PIX_FMT_RGB32:
alt_t = gst_structure_copy (template);
gst_structure_set (alt_t, "format", G_TYPE_STRING, "ARGB", NULL);
break;
case V4L2_PIX_FMT_BGR32:
alt_t = gst_structure_copy (template);
gst_structure_set (alt_t, "format", G_TYPE_STRING, "BGRA", NULL);
default:
break;
}
gst_caps_append_structure (caps, template); gst_caps_append_structure (caps, template);
if (alt_t)
gst_caps_append_structure (caps, alt_t);
}
} }
return gst_caps_simplify (caps); return gst_caps_simplify (caps);
......
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