Multistream cases are periodically failing because of improper caps negotiation. This fix has already been backported in upstream gstreamer and was part of official 1.28.8 release.
This patch will be dropped from meta-arago once oe-core migrates to latest 1.28.x version. Signed-off-by: Brandon Brnich <[email protected]> --- Wrynose is only on version 1.28.5 - it will be quite some time before the migration is done to 1.28.8. Without this patch, multistream decode isn't reliable. Master is closer - currently sitting at 1.28.7. Gstreamer just released 1.28.8 on Octber 8th and master will soon move so I don't plan to port this to master. ...t-corrupt-the-caller-s-filter-caps-w.patch | 55 +++++++++++++++++++ .../gstreamer1.0-plugins-good_1.28-arago.inc | 1 + 2 files changed, 56 insertions(+) create mode 100644 meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0008-v4l2-object-Don-t-corrupt-the-caller-s-filter-caps-w.patch diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0008-v4l2-object-Don-t-corrupt-the-caller-s-filter-caps-w.patch b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0008-v4l2-object-Don-t-corrupt-the-caller-s-filter-caps-w.patch new file mode 100644 index 00000000..31b147ad --- /dev/null +++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0008-v4l2-object-Don-t-corrupt-the-caller-s-filter-caps-w.patch @@ -0,0 +1,55 @@ +From 872040cd7cc755bd970e4642a521168d6e19df63 Mon Sep 17 00:00:00 2001 +From: Qi Hou <[email protected]> +Date: Wed, 23 Sep 2026 15:31:30 +0900 +Subject: [PATCH] v4l2: object: Don't corrupt the caller's filter caps when + probing + +In gst_v4l2_object_probe_caps(), the DMABuf candidate branch built the +temporary format_caps with gst_caps_append_structure() and then called +gst_caps_set_features() on the incoming filter caps to attach +GST_CAPS_FEATURE_MEMORY_DMABUF. + +That is wrong for three reasons: + + - filter is owned by the caller (the pad caps query), so modifying it + leaks a side effect back to the caller and can hit a writability + assertion when the caps refcount is greater than one. + - only structure index 0 was touched, leaving any other structure in + the filter untouched. + - the feature belongs on the candidate caps we are about to intersect + against the filter, not on the filter itself, so the pre-probe + intersection test could pick the wrong formats. + +Attach the memory:DMABuf feature to the candidate structure directly via +gst_caps_append_structure_full(), which is what the rest of the file +(gst_v4l2_object_get_caps_helper(), gst_v4l2_object_update_and_append()) +already does, and leave filter untouched. + +No functional change intended for the resulting probed caps; this only +fixes the filter corruption and makes the cheap pre-probe rejection test +behave as documented. + +Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/12529> +Upstream-Status: Backport [1.28.8] +--- + sys/v4l2/gstv4l2object.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c +index 7d35c34..9dd0c46 100644 +--- a/sys/v4l2/gstv4l2object.c ++++ b/sys/v4l2/gstv4l2object.c +@@ -5475,9 +5475,10 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter) + GstCaps *format_caps = gst_caps_new_empty (); + + if (dmabuf_tmpl) { +- gst_caps_append_structure (format_caps, +- gst_structure_copy (dmabuf_tmpl)); +- gst_caps_set_features (filter, 0, ++ /* Tag the candidate structure itself with the DMABuf memory feature ++ * instead of corrupting the caller owned filter caps. */ ++ gst_caps_append_structure_full (format_caps, ++ gst_structure_copy (dmabuf_tmpl), + gst_caps_features_new_single_static_str + (GST_CAPS_FEATURE_MEMORY_DMABUF)); + add_alternate_variant (v4l2object, format_caps, dmabuf_tmpl, diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.28-arago.inc b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.28-arago.inc index a2204efb..2d3d85bb 100644 --- a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.28-arago.inc +++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.28-arago.inc @@ -8,6 +8,7 @@ SRC_URI:append = " \ file://0005-HACK-gstv4l2object-Increase-min-buffers-for-CSI-capt.patch \ file://0006-v4l2object-use-actual-stream-resolution-for-encoded-.patch \ file://0007-v4l2object-Attempt-non-contiguous-if-contiguous-form.patch \ + file://0008-v4l2-object-Don-t-corrupt-the-caller-s-filter-caps-w.patch \ " PR:append = ".arago0" -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#17739): https://lists.yoctoproject.org/g/meta-arago/message/17739 Mute This Topic: https://lists.yoctoproject.org/mt/121722071/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
