d3d11compositor: Skip zero alpha input
authorSeungha Yang <seungha@centricular.com>
Mon, 17 Apr 2023 12:34:19 +0000 (21:34 +0900)
committerSeungha Yang <seungha@centricular.com>
Fri, 21 Apr 2023 17:27:49 +0000 (17:27 +0000)
Blending such input is a waste of resource since nothing will
be rendered

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

subprojects/gst-plugins-bad/sys/d3d11/gstd3d11compositor.cpp

index d777aaa..80a0a95 100644 (file)
@@ -766,6 +766,9 @@ gst_d3d11_compositor_pad_check_frame_obscured (GstVideoAggregatorPad * pad,
    *     left unscaled)
    */
 
+  if (cpad->alpha == 0)
+    return TRUE;
+
   gst_d3d11_compositor_pad_get_output_size (cpad, GST_VIDEO_INFO_PAR_N (info),
       GST_VIDEO_INFO_PAR_D (info), &width, &height, &x_offset, &y_offset);