[vlc-commits] vdpau/picture: pass a vdpau_decoder_device_t internally

Steve Lhomme git at videolan.org
Mon Dec 2 13:43:23 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Nov 22 10:58:26 2019 +0100| [a34dc10dbc19594954a53b5a389fb9b3fdae99e2] | committer: Steve Lhomme

vdpau/picture: pass a vdpau_decoder_device_t internally

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a34dc10dbc19594954a53b5a389fb9b3fdae99e2
---

 modules/hw/vdpau/picture.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/hw/vdpau/picture.c b/modules/hw/vdpau/picture.c
index dda8e29023..7f4e332253 100644
--- a/modules/hw/vdpau/picture.c
+++ b/modules/hw/vdpau/picture.c
@@ -147,22 +147,24 @@ static void vlc_vdp_output_surface_destroy(picture_t *pic)
 }
 
 static
-picture_t *vlc_vdp_output_surface_create(vdp_t *vdp, VdpRGBAFormat rgb_fmt,
+picture_t *vlc_vdp_output_surface_create(vdpau_decoder_device_t *vdpau_dev,
+                                         VdpRGBAFormat rgb_fmt,
                                          const video_format_t *restrict fmt)
 {
     vlc_vdp_output_surface_t *sys = malloc(sizeof (*sys));
     if (unlikely(sys == NULL))
         return NULL;
 
-    sys->vdp = vdp_hold_x11(vdp, &sys->device);
+    sys->vdp = vdp_hold_x11(vdpau_dev->vdp, &sys->device);
     sys->gl_nv_surface = 0;
 
-    VdpStatus err = vdp_output_surface_create(vdp, sys->device, rgb_fmt,
+    VdpStatus err = vdp_output_surface_create(vdpau_dev->vdp, vdpau_dev->device,
+        rgb_fmt,
         fmt->i_visible_width, fmt->i_visible_height, &sys->surface);
     if (err != VDP_STATUS_OK)
     {
 error:
-        vdp_release_x11(vdp);
+        vdp_release_x11(vdpau_dev->vdp);
         free(sys);
         return NULL;
     }
@@ -175,7 +177,7 @@ error:
     picture_t *pic = picture_NewFromResource(fmt, &res);
     if (unlikely(pic == NULL))
     {
-        vdp_output_surface_destroy(vdp, sys->surface);
+        vdp_output_surface_destroy(vdpau_dev->vdp, sys->surface);
         goto error;
     }
     return pic;
@@ -191,7 +193,7 @@ picture_pool_t *vlc_vdp_output_pool_create(vdpau_decoder_device_t *vdpau_dev,
 
     while (count < requested_count)
     {
-        pics[count] = vlc_vdp_output_surface_create(vdpau_dev->vdp, rgb_fmt, fmt);
+        pics[count] = vlc_vdp_output_surface_create(vdpau_dev, rgb_fmt, fmt);
         if (pics[count] == NULL)
             break;
         count++;



More information about the vlc-commits mailing list