compositor: a pad without a frame can't obscure the background
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 26 Nov 2020 14:57:10 +0000 (15:57 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 22 Apr 2022 17:43:50 +0000 (17:43 +0000)
Skip those when considering whether the background should be
drawn

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

subprojects/gst-plugins-base/gst/compositor/compositor.c

index 1046db8..1c08715 100644 (file)
@@ -1241,7 +1241,10 @@ _should_draw_background (GstVideoAggregator * vagg)
   /* Check if the background is completely obscured by a pad
    * TODO: Also skip if it's obscured by a combination of pads */
   for (l = GST_ELEMENT (vagg)->sinkpads; l; l = l->next) {
-    if (gst_aggregator_pad_is_inactive (GST_AGGREGATOR_PAD (l->data)))
+    if (gst_aggregator_pad_is_inactive (GST_AGGREGATOR_PAD (l->data))
+        ||
+        gst_video_aggregator_pad_get_prepared_frame (GST_VIDEO_AGGREGATOR_PAD
+            (l->data)) == NULL)
       continue;
 
     if (_pad_obscures_rectangle (vagg, l->data, bg_rect)) {