[vlc-commits] vdpau: rename picture_sys_t to vlc_vdp_output_surface_t

Rémi Denis-Courmont git at videolan.org
Fri Dec 21 21:05:10 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 21 21:32:36 2018 +0200| [531795380af5490554d268c79a4458921e6621bf] | committer: Rémi Denis-Courmont

vdpau: rename picture_sys_t to vlc_vdp_output_surface_t

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

 modules/hw/vdpau/chroma.c                     |  4 ++--
 modules/hw/vdpau/display.c                    |  8 ++++----
 modules/hw/vdpau/vlc_vdpau.h                  | 17 +++++++++--------
 modules/video_output/opengl/converter_vdpau.c |  8 +++++---
 4 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index 009595da80..666d7c7904 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -516,7 +516,7 @@ static picture_t *Render(filter_t *filter, picture_t *src, bool import)
     if (dst == NULL)
         goto skip;
 
-    picture_sys_t *p_sys = dst->p_sys;
+    vlc_vdp_output_surface_t *p_sys = dst->p_sys;
     assert(p_sys != NULL && p_sys->vdp == sys->vdp);
     dst->date = sys->history[MAX_PAST].date;
     dst->b_force = sys->history[MAX_PAST].force;
@@ -756,7 +756,7 @@ static int OutputOpen(vlc_object_t *obj)
     if (pic == NULL)
         goto error;
 
-    picture_sys_t *picsys = pic->p_sys;
+    vlc_vdp_output_surface_t *picsys = pic->p_sys;
     assert(picsys != NULL && picsys->vdp != NULL);
 
     sys->vdp = vdp_hold_x11(picsys->vdp, NULL);
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index ac16dd484f..b01809c548 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -70,7 +70,7 @@ struct vout_display_sys_t
     unsigned height;
 };
 
-static void pictureSys_DestroyVDPAU(picture_sys_t *psys)
+static void pictureSys_DestroyVDPAU(vlc_vdp_output_surface_t *psys)
 {
     vdp_output_surface_destroy(psys->vdp, psys->surface);
     vdp_release_x11(psys->vdp);
@@ -86,7 +86,7 @@ static VdpStatus picture_NewVDPAU(vdp_t *vdp, VdpRGBAFormat rgb_fmt,
                                   const video_format_t *restrict fmt,
                                   picture_t **restrict picp)
 {
-    picture_sys_t *psys = malloc(sizeof (*psys));
+    vlc_vdp_output_surface_t *psys = malloc(sizeof (*psys));
     if (unlikely(psys == NULL))
         return VDP_STATUS_RESOURCES;
 
@@ -245,7 +245,7 @@ static void Queue(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
                   vlc_tick_t date)
 {
     vout_display_sys_t *sys = vd->sys;
-    picture_sys_t *p_sys = pic->p_sys;
+    vlc_vdp_output_surface_t *p_sys = pic->p_sys;
     VdpOutputSurface surface = p_sys->surface;
     VdpStatus err;
 
@@ -301,7 +301,7 @@ static void Wait(vout_display_t *vd, picture_t *pic)
     picture_t *current = sys->current;
     if (current != NULL)
     {
-        picture_sys_t *psys = current->p_sys;
+        vlc_vdp_output_surface_t *psys = current->p_sys;
         VdpTime pts;
         VdpStatus err;
 
diff --git a/modules/hw/vdpau/vlc_vdpau.h b/modules/hw/vdpau/vlc_vdpau.h
index 892e717ea0..bdb61b51f5 100644
--- a/modules/hw/vdpau/vlc_vdpau.h
+++ b/modules/hw/vdpau/vlc_vdpau.h
@@ -256,14 +256,6 @@ bool vlc_fourcc_to_vdp_ycc(vlc_fourcc_t fourcc,
     return true;
 }
 
-typedef struct
-{
-    VdpOutputSurface surface;
-    VdpDevice device;
-    vdp_t *vdp;
-    void *gl_nv_surface;
-} picture_sys_t;
-
 typedef struct vlc_vdp_video_frame
 {
     VdpVideoSurface surface;
@@ -305,4 +297,13 @@ static inline vlc_vdp_video_field_t *vlc_vdp_video_copy(
 {
     return (vlc_vdp_video_field_t *)fold->context.copy(&fold->context);
 }
+
+typedef struct vlc_vdp_output_surface
+{
+    VdpOutputSurface surface;
+    VdpDevice device;
+    vdp_t *vdp;
+    void *gl_nv_surface;
+} vlc_vdp_output_surface_t;
+
 #endif
diff --git a/modules/video_output/opengl/converter_vdpau.c b/modules/video_output/opengl/converter_vdpau.c
index 1bc0d3b8a7..4129f7bdf7 100644
--- a/modules/video_output/opengl/converter_vdpau.c
+++ b/modules/video_output/opengl/converter_vdpau.c
@@ -66,7 +66,8 @@ static PFNGLVDPAUUNMAPSURFACESNVPROC            _glVDPAUUnmapSurfacesNV;
 static void
 pool_pic_destroy_cb(picture_t *pic)
 {
-    picture_sys_t *p_sys = pic->p_sys;
+    vlc_vdp_output_surface_t *p_sys = pic->p_sys;
+
     vdp_output_surface_destroy(p_sys->vdp, p_sys->surface);
     vdp_release_x11(p_sys->vdp);
     free(p_sys);
@@ -92,13 +93,14 @@ tc_vdpau_gl_get_pool(opengl_tex_converter_t const *tc,
                                             &surface)) != VDP_STATUS_OK)
             goto error;
 
-        picture_sys_t *picsys = calloc(1, sizeof(*picsys));
+        vlc_vdp_output_surface_t *picsys = malloc(sizeof (*picsys));
         if (!picsys)
             goto error;
 
         picsys->vdp = vdp_hold_x11(priv->vdp, NULL);
         picsys->device = priv->vdp_device;
         picsys->surface = surface;
+        *(GLvdpauSurfaceNV *)&picsys->gl_nv_surface = 0;
 
         picture_resource_t rsc = { .p_sys = picsys,
                                    .pf_destroy = pool_pic_destroy_cb };
@@ -129,7 +131,7 @@ tc_vdpau_gl_update(opengl_tex_converter_t const *tc, GLuint textures[],
     VLC_UNUSED(tex_heights);
     VLC_UNUSED(plane_offsets);
 
-    picture_sys_t *p_sys = pic->p_sys;
+    vlc_vdp_output_surface_t *p_sys = pic->p_sys;
 
     GLvdpauSurfaceNV *p_gl_nv_surface =
         (GLvdpauSurfaceNV *)&p_sys->gl_nv_surface;



More information about the vlc-commits mailing list