Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBing Song <bing.song@nxp.com>2020-11-12 04:32:30 +0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-11-16 18:12:28 +0300
commit8a0a7d932a6f31bebbd8f140d4ba440f16091d68 (patch)
tree87bb6be6b08bcb577b26068c44200417b9356506 /sys
parent79748dab2bcb54e49a7401a9507f27993f9f42ad (diff)
v4l2: caps negotiate wrong as interlace feature
gst_caps_simplify() will move interlace format before normal video format. It will cause caps negotiate prefer interlaced caps which isn't expected. Seperate normal caps and interlaced caps and then merge it will keep prefer progress video format. Add ARGB/BGRA for interlaced caps. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/802 Part-of <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/813> Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/813>
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index da64ec060..c6d1f5fd8 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -1644,10 +1644,11 @@ static GstCaps *
gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
{
GstStructure *structure;
- GstCaps *caps;
+ GstCaps *caps, *caps_interlaced;
guint i;
caps = gst_caps_new_empty ();
+ caps_interlaced = gst_caps_new_empty ();
for (i = 0; i < GST_V4L2_FORMAT_COUNT; i++) {
if ((gst_v4l2_formats[i].flags & flags) == 0)
@@ -1680,14 +1681,19 @@ gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
gst_caps_append_structure (caps, structure);
- if (alt_s)
+ if (alt_s) {
gst_caps_append_structure (caps, alt_s);
+ add_alternate_variant (NULL, caps_interlaced, alt_s);
+ }
- add_alternate_variant (NULL, caps, structure);
+ add_alternate_variant (NULL, caps_interlaced, structure);
}
}
- return gst_caps_simplify (caps);
+ caps = gst_caps_simplify (caps);
+ caps_interlaced = gst_caps_simplify (caps_interlaced);
+
+ return gst_caps_merge (caps, caps_interlaced);
}
GstCaps *