[vlc-commits] [Git][videolan/vlc][master] 2 commits: xcb/render: fix SPU offset

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Jun 6 21:13:24 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
48e390e5 by Rémi Denis-Courmont at 2022-06-06T21:01:46+00:00
xcb/render: fix SPU offset

- - - - -
329bd3c8 by Rémi Denis-Courmont at 2022-06-06T21:01:46+00:00
vdpau/display: fix SPU blending offsets

- - - - -


2 changed files:

- modules/hw/vdpau/display.c
- modules/video_output/xcb/render.c


Changes:

=====================================
modules/hw/vdpau/display.c
=====================================
@@ -94,8 +94,8 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
 
     /* Create GPU surface for sub-picture */
     err = vdp_bitmap_surface_create(sys->vdp, sys->device, fmt,
-        reg->fmt.i_visible_width, reg->fmt.i_visible_height, VDP_FALSE,
-                                    &surface);
+                                    reg->fmt.i_width, reg->fmt.i_height,
+                                    VDP_FALSE, &surface);
     if (err != VDP_STATUS_OK)
     {
         msg_Err(vd, "%s creation failure: %s", "bitmap surface",
@@ -118,7 +118,7 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
     }
 
     /* Render onto main surface */
-    VdpRect area = {
+    VdpRect dst_area = {
         reg->i_x * sys->width
             / subpic->i_original_picture_width,
         reg->i_y * sys->height
@@ -128,6 +128,12 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
         (reg->i_y + reg->fmt.i_visible_height) * sys->height
             / subpic->i_original_picture_height,
     };
+    VdpRect src_area = {
+        reg->fmt.i_x_offset,
+        reg->fmt.i_y_offset,
+        reg->fmt.i_x_offset + reg->fmt.i_visible_width,
+        reg->fmt.i_y_offset + reg->fmt.i_visible_height,
+    };
     VdpColor color = { 1.f, 1.f, 1.f,
         reg->i_alpha * subpic->i_alpha / 65025.f };
     VdpOutputSurfaceRenderBlendState state = {
@@ -145,8 +151,9 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
         .blend_constant = { 0.f, 0.f, 0.f, 0.f },
     };
 
-    err = vdp_output_surface_render_bitmap_surface(sys->vdp, target, &area,
-                                             surface, NULL, &color, &state, 0);
+    err = vdp_output_surface_render_bitmap_surface(sys->vdp, target, &dst_area,
+                                                   surface, &src_area, &color,
+                                                   &state, 0);
     if (err != VDP_STATUS_OK)
         msg_Err(vd, "blending failure: %s",
                 vdp_get_error_string(sys->vdp, err));


=====================================
modules/video_output/xcb/render.c
=====================================
@@ -172,7 +172,10 @@ static void RenderRegion(vout_display_t *vd, const subpicture_t *subpic,
 
     xcb_render_composite(conn, XCB_RENDER_PICT_OP_OVER,
                          sys->picture.subpic, sys->picture.alpha,
-                         sys->picture.scale, 0, 0, 0, 0, dx, dy, dw, dh);
+                         sys->picture.scale,
+                         reg->fmt.i_x_offset, reg->fmt.i_y_offset,
+                         reg->fmt.i_x_offset, reg->fmt.i_y_offset,
+                         dx, dy, dw, dh);
 
     xcb_render_free_picture(conn, sys->picture.alpha);
     xcb_render_free_picture(conn, sys->picture.subpic);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/736f43bc75c5f3c5529cacb822911087313de9d7...329bd3c8a3d73b77263b5d98e4e0d2a9e3f9e638

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/736f43bc75c5f3c5529cacb822911087313de9d7...329bd3c8a3d73b77263b5d98e4e0d2a9e3f9e638
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list