[vlc-devel] [PATCH v3 11/20] vdpau/display: use the picture placement from the core

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


---
 modules/hw/vdpau/display.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 4eb937c00d8..772553b8971 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -233,20 +233,19 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     {
         video_format_t *fmt = va_arg(ap, video_format_t *);
         const video_format_t *src= &vd->source;
-        vout_display_place_t place;
+        const vout_display_place_t *place = vd->place;
 
         msg_Dbg(vd, "resetting pictures");
-        vout_display_PlacePicture(&place, src, vd->cfg);
 
-        fmt->i_width = src->i_width * place.width / src->i_visible_width;
-        fmt->i_height = src->i_height * place.height / src->i_visible_height;
-        sys->width = fmt->i_visible_width = place.width;
-        sys->height = 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 / src->i_visible_height;
+        fmt->i_width = src->i_width * place->width / src->i_visible_width;
+        fmt->i_height = src->i_height * place->height / src->i_visible_height;
+        sys->width = fmt->i_visible_width = place->width;
+        sys->height = 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 / src->i_visible_height;
 
-        const uint32_t values[] = { place.x, place.y,
-                                    place.width, place.height, };
+        const uint32_t values[] = { place->x, place->y,
+                                    place->width, place->height, };
         xcb_configure_window(sys->conn, sys->window,
                              XCB_CONFIG_WINDOW_X|XCB_CONFIG_WINDOW_Y|
                              XCB_CONFIG_WINDOW_WIDTH|XCB_CONFIG_WINDOW_HEIGHT,
@@ -255,15 +254,14 @@ static int Control(vout_display_t *vd, int query, va_list ap)
     }
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
     {
-        vout_display_place_t place;
+        const vout_display_place_t *place = vd->place;
 
-        vout_display_PlacePicture(&place, &vd->source, vd->cfg);
-        if (place.width  != vd->fmt.i_visible_width
-         || place.height != vd->fmt.i_visible_height)
+        if (place->width  != vd->fmt.i_visible_width
+         || place->height != vd->fmt.i_visible_height)
             return VLC_EGENERIC;
 
-        const uint32_t values[] = { place.x, place.y,
-                                    place.width, place.height, };
+        const uint32_t values[] = { place->x, place->y,
+                                    place->width, place->height, };
         xcb_configure_window(sys->conn, sys->window,
                              XCB_CONFIG_WINDOW_X|XCB_CONFIG_WINDOW_Y|
                              XCB_CONFIG_WINDOW_WIDTH|XCB_CONFIG_WINDOW_HEIGHT,
-- 
2.26.2



More information about the vlc-devel mailing list