waylandsink: Crop surfaces to their display width height
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 29 Aug 2023 18:55:03 +0000 (14:55 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 7 Sep 2023 20:48:05 +0000 (20:48 +0000)
Setting the surface source rectangle has been omitted so far. As a side effect
surface created with padded width/height are being scaled down. Fix this using
the viewporter source rectangle configuration. This can later be enhanced
to support crop meta.

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

subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c

index 6004993..d6fa86d 100644 (file)
@@ -449,6 +449,9 @@ gst_wl_window_resize_video_surface (GstWlWindow * self, gboolean commit)
   /* center the video_subsurface inside area_subsurface */
   if (priv->video_viewport) {
     gst_video_center_rect (&src, &dst, &res, TRUE);
+    wp_viewport_set_source (priv->video_viewport, wl_fixed_from_int (0),
+        wl_fixed_from_int (0), wl_fixed_from_int (priv->video_width),
+        wl_fixed_from_int (priv->video_height));
     wp_viewport_set_destination (priv->video_viewport, res.w, res.h);
   } else {
     gst_video_center_rect (&src, &dst, &res, FALSE);