videoaggregator: Don't force upstream alpha format
authorSeungha Yang <seungha@centricular.com>
Fri, 1 Jul 2022 21:08:57 +0000 (06:08 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 21 Jul 2022 21:34:06 +0000 (21:34 +0000)
"video/x-raw,format=RGBA ! some-video-filter ! video/x-raw,format=NV12"
is a very common case and therefore such erroring at baseclass
does not seem to be a desired behavior.

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

subprojects/gst-plugins-base/gst-libs/gst/video/gstvideoaggregator.c

index f414b9c..31e9d70 100644 (file)
@@ -1296,9 +1296,7 @@ gst_video_aggregator_default_negotiated_src_caps (GstAggregator * agg,
     GstCaps * caps)
 {
   GstVideoAggregator *vagg = GST_VIDEO_AGGREGATOR (agg);
-  gboolean at_least_one_alpha = FALSE;
   gboolean ret = FALSE;
-  const GstVideoFormatInfo *finfo;
   GstVideoInfo info;
   GList *l;
 
@@ -1313,9 +1311,6 @@ gst_video_aggregator_default_negotiated_src_caps (GstAggregator * agg,
     if (GST_VIDEO_INFO_WIDTH (&mpad->info) == 0
         || GST_VIDEO_INFO_HEIGHT (&mpad->info) == 0)
       continue;
-
-    if (mpad->info.finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)
-      at_least_one_alpha = TRUE;
   }
   GST_OBJECT_UNLOCK (vagg);
 
@@ -1338,15 +1333,6 @@ gst_video_aggregator_default_negotiated_src_caps (GstAggregator * agg,
   vagg->info = info;
   GST_OBJECT_UNLOCK (vagg);
 
-  finfo = info.finfo;
-
-  if (at_least_one_alpha && !(finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)) {
-    GST_ELEMENT_ERROR (vagg, CORE, NEGOTIATION,
-        ("At least one of the input pads contains alpha, but configured caps don't support alpha."),
-        ("Either convert your inputs to not contain alpha or add a videoconvert after the aggregator"));
-    goto unlock_and_return;
-  }
-
   /* Then browse the sinks once more, setting or unsetting conversion if needed */
   gst_element_foreach_sink_pad (GST_ELEMENT_CAST (vagg),
       _update_conversion_info, NULL);