mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 13:21:28 +00:00
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:
parent
ce922a413c
commit
0b648f9a2d
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue