videobox: avoid dropping caps fields for passthrough caps transform
authorMark Nauwelaerts <mnauw@users.sourceforge.net>
Fri, 22 Jul 2022 12:51:11 +0000 (14:51 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 29 Jul 2022 18:44:13 +0000 (18:44 +0000)
Fixes potential negotiation failure in case downstream element
is a bit picky regarding the fields in question.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2786>

subprojects/gst-plugins-good/gst/videobox/gstvideobox.c

index 9c69e49..302e714 100644 (file)
@@ -2949,11 +2949,13 @@ gst_video_box_transform_caps (GstBaseTransform * trans,
       gst_structure_set_value (structure, "format", &val);
       g_value_unset (&val);
       g_value_unset (&list);
-    }
-
-    gst_structure_remove_field (structure, "colorimetry");
-    gst_structure_remove_field (structure, "chroma-site");
 
+      /* format list above makes for non-fixed caps;
+       * so basetransform and peers will be enlisted to decide these parts,
+       * otherwise leave as-is for passthrough case */
+      gst_structure_remove_field (structure, "colorimetry");
+      gst_structure_remove_field (structure, "chroma-site");
+    }
     gst_caps_append_structure (to, structure);
   }