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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5259>
This commit is contained in:
Nicolas Dufresne 2023-08-29 14:55:03 -04:00 committed by GStreamer Marge Bot
parent ce922a413c
commit 0b648f9a2d

View file

@ -449,6 +449,9 @@ gst_wl_window_resize_video_surface (GstWlWindow * self, gboolean commit)
/* center the video_subsurface inside area_subsurface */ /* center the video_subsurface inside area_subsurface */
if (priv->video_viewport) { if (priv->video_viewport) {
gst_video_center_rect (&src, &dst, &res, TRUE); 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); wp_viewport_set_destination (priv->video_viewport, res.w, res.h);
} else { } else {
gst_video_center_rect (&src, &dst, &res, FALSE); gst_video_center_rect (&src, &dst, &res, FALSE);