[vlc-devel] [PATCH v3 12/20] wayland/shm: use the picture placement from the core

Steve Lhomme robux4 at ycbcr.xyz
Wed Aug 26 13:55:39 CEST 2020


---
 modules/video_output/wayland/shm.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index ffd028c385e..4ec6664bd6c 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -161,22 +161,21 @@ static int Control(vout_display_t *vd, int query, va_list ap)
         case VOUT_DISPLAY_RESET_PICTURES:
         {
             video_format_t *fmt = va_arg(ap, video_format_t *);
-            vout_display_place_t place;
+            const vout_display_place_t *place = vd->place;
             video_format_t src;
             assert(sys->viewport == NULL);
 
-            vout_display_PlacePicture(&place, &vd->source, vd->cfg);
             video_format_ApplyRotation(&src, &vd->source);
 
-            fmt->i_width  = src.i_width * place.width
+            fmt->i_width  = src.i_width * place->width
                                         / src.i_visible_width;
-            fmt->i_height = src.i_height * place.height
+            fmt->i_height = src.i_height * place->height
                                          / src.i_visible_height;
-            fmt->i_visible_width  = place.width;
-            fmt->i_visible_height = place.height;
-            fmt->i_x_offset = src.i_x_offset * place.width
+            fmt->i_visible_width  = place->width;
+            fmt->i_visible_height = place->height;
+            fmt->i_x_offset = src.i_x_offset * place->width
                                              / src.i_visible_width;
-            fmt->i_y_offset = src.i_y_offset * place.height
+            fmt->i_y_offset = src.i_y_offset * place->height
                                              / src.i_visible_height;
             break;
         }
@@ -193,10 +192,9 @@ static int Control(vout_display_t *vd, int query, va_list ap)
             if (sys->viewport != NULL)
             {
                 video_format_t fmt;
-                vout_display_place_t place;
+                const vout_display_place_t *place = vd->place;
 
                 video_format_ApplyRotation(&fmt, &vd->source);
-                vout_display_PlacePicture(&place, &vd->source, vd->cfg);
 
                 wp_viewport_set_source(sys->viewport,
                                 wl_fixed_from_int(fmt.i_x_offset),
@@ -204,7 +202,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
                                 wl_fixed_from_int(fmt.i_visible_width),
                                 wl_fixed_from_int(fmt.i_visible_height));
                 wp_viewport_set_destination(sys->viewport,
-                                            place.width, place.height);
+                                            place->width, place->height);
             }
             else
                 return VLC_EGENERIC;
-- 
2.26.2



More information about the vlc-devel mailing list