From 0b648f9a2d1e620c06b304e14e5b02f154a3f407 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 29 Aug 2023 14:55:03 -0400 Subject: [PATCH] waylandsink: Crop surfaces to their display width height 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: --- subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c b/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c index afdbc10816..4026aa8b25 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlwindow.c @@ -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);