[vlc-commits] [Git][videolan/vlc][master] vout display: make sys a void pointer

Romain Vimont (@rom1v) gitlab at videolan.org
Wed Jul 7 09:41:02 UTC 2021



Romain Vimont pushed to branch master at VideoLAN / VLC


Commits:
3af1b9dc by Romain Vimont at 2021-07-07T09:26:17+00:00
vout display: make sys a void pointer

The concrete sys type is local to each module.

- - - - -


26 changed files:

- include/vlc_vout_display.h
- modules/hw/mmal/vout.c
- modules/hw/vdpau/display.c
- modules/video_output/android/display.c
- modules/video_output/caca.c
- modules/video_output/caopengllayer.m
- modules/video_output/decklink.cpp
- modules/video_output/fb.c
- modules/video_output/flaschen.c
- modules/video_output/kms.c
- modules/video_output/kva.c
- modules/video_output/libplacebo/display.c
- modules/video_output/macosx.m
- modules/video_output/opengl/display.c
- modules/video_output/splitter.c
- modules/video_output/vgl.c
- modules/video_output/vmem.c
- modules/video_output/wayland/shm.c
- modules/video_output/win32/direct3d11.c
- modules/video_output/win32/direct3d9.c
- modules/video_output/win32/glwin32.c
- modules/video_output/win32/wgl.c
- modules/video_output/win32/wingdi.c
- modules/video_output/xcb/render.c
- modules/video_output/xcb/x11.c
- modules/video_output/yuv.c


Changes:

=====================================
include/vlc_vout_display.h
=====================================
@@ -44,7 +44,6 @@
  */
 
 typedef struct vout_display_t vout_display_t;
-typedef struct vout_display_sys_t vout_display_sys_t;
 typedef struct vout_display_owner_t vout_display_owner_t;
 
 /**
@@ -365,7 +364,7 @@ struct vout_display_t {
      *
      * A module is free to use it as it wishes.
      */
-    vout_display_sys_t *sys;
+    void *sys;
 
     /**
      * Callbacks the display module must set on Open.


=====================================
modules/hw/mmal/vout.c
=====================================
@@ -91,7 +91,7 @@ typedef struct vout_subpic_s {
     subpic_reg_stash_t sub;
 } vout_subpic_t;
 
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     vlc_mutex_t manage_mutex;
 
     vlc_decoder_device *dec_dev;
@@ -145,7 +145,7 @@ struct vout_display_sys_t {
 
     // Subpic blend if we have to do it here
     vzc_pool_ctl_t * vzc;
-};
+} vout_display_sys_t;
 
 
 // ISP setup
@@ -238,7 +238,8 @@ static void isp_output_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf)
         // The filter structure etc. should always exist if we have contents
         // but might not on later flushes as we shut down
         vout_display_t * const vd = (vout_display_t *)port->userdata;
-        struct vout_isp_conf_s *const isp = &vd->sys->isp;
+        vout_display_sys_t *sys = vd->sys;
+        struct vout_isp_conf_s *const isp = &sys->isp;
 
         mmal_queue_put(isp->out_q, buf);
     }
@@ -955,13 +956,14 @@ static void adjust_refresh_rate(vout_display_t *vd, const video_format_t *fmt)
 
 static void maintain_phase_sync(vout_display_t *vd)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     MMAL_PARAMETER_VIDEO_RENDER_STATS_T render_stats = {
         .hdr = { MMAL_PARAMETER_VIDEO_RENDER_STATS, sizeof(render_stats) },
     };
     int32_t frame_duration = CLOCK_FREQ /
-        ((double)vd->sys->i_frame_rate /
-        vd->sys->i_frame_rate_base);
-    vout_display_sys_t *sys = vd->sys;
+        ((double)sys->i_frame_rate /
+        sys->i_frame_rate_base);
     int32_t phase_offset;
     MMAL_STATUS_T status;
 


=====================================
modules/hw/vdpau/display.c
=====================================
@@ -51,7 +51,7 @@ vlc_module_begin()
     add_shortcut("vdpau")
 vlc_module_end()
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     xcb_connection_t *conn; /**< XCB connection */
     vdp_t *vdp; /**< VDPAU back-end */
@@ -64,7 +64,7 @@ struct vout_display_sys_t
 
     unsigned width;
     unsigned height;
-};
+} vout_display_sys_t;
 
 static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
                          const subpicture_t *subpic,


=====================================
modules/video_output/android/display.c
=====================================
@@ -104,7 +104,7 @@ struct buffer_bounds
     ARect bounds;
 };
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_window_t *embed;
 
@@ -129,7 +129,7 @@ struct vout_display_sys_t
     ARect sub_last_region;
 
     bool b_has_subpictures;
-};
+} vout_display_sys_t;
 
 #define PRIV_WINDOW_FORMAT_YV12 0x32315659
 


=====================================
modules/video_output/caca.c
=====================================
@@ -47,7 +47,7 @@
 #include <caca.h>
 
 /* */
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     cucul_canvas_t *cv;
     caca_display_t *dp;
     cucul_dither_t *dither;
@@ -60,7 +60,7 @@ struct vout_display_sys_t {
 
     vlc_tick_t cursor_timeout;
     vlc_tick_t cursor_deadline;
-};
+} vout_display_sys_t;
 
 typedef struct vlc_caca_event {
     struct vlc_caca_event *next;


=====================================
modules/video_output/caopengllayer.m
=====================================
@@ -87,7 +87,7 @@ static void OpenglSwap         (vlc_gl_t *gl);
 @end
 
 
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
 
     CALayer <VLCCoreAnimationVideoLayerEmbedding> *container;
     vout_window_t *embed;
@@ -99,7 +99,7 @@ struct vout_display_sys_t {
     vout_display_place_t place;
 
     bool  b_frame_available;
-};
+} vout_display_sys_t;
 
 struct gl_sys
 {
@@ -449,7 +449,9 @@ static void *OurGetProcAddress (vlc_gl_t *gl, const char *name)
     if (!_voutDisplay)
         return false;
 
-    return _voutDisplay->sys->b_frame_available;
+    vout_display_sys_t *sys = _voutDisplay->sys;
+
+    return sys->b_frame_available;
 }
 
 - (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp


=====================================
modules/video_output/decklink.cpp
=====================================
@@ -804,7 +804,7 @@ static int OpenVideo(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     vd->ops = &ops;
 
-    vd->sys = (vout_display_sys_t*) sys;
+    vd->sys = (void *) sys;
 
     return VLC_SUCCESS;
 }


=====================================
modules/video_output/fb.c
=====================================
@@ -107,7 +107,7 @@ static int  TtyInit(vout_display_t *);
 static void TtyExit(vout_display_t *);
 
 /* */
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     /* System information */
     int                 tty;                          /* tty device handle */
     bool                is_tty;
@@ -140,7 +140,7 @@ struct vout_display_sys_t {
     size_t      video_size;                                    /* page size */
 
     picture_t       *picture;
-};
+} vout_display_sys_t;
 
 
 static void ClearScreen(vout_display_sys_t *sys)
@@ -326,7 +326,7 @@ static void Display(vout_display_t *vd, picture_t *picture)
     /* swap the two Y offsets if the drivers supports panning */
     if (sys->has_pan) {
         sys->var_info.yoffset = 0;
-        /*vd->sys->var_info.yoffset = vd->sys->var_info.yres; */
+        /*sys->var_info.yoffset = sys->var_info.yres; */
 
         /* the X offset should be 0, but who knows ...
          * some other app might have played with the framebuffer */


=====================================
modules/video_output/flaschen.c
=====================================
@@ -75,9 +75,9 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     int             fd;
-};
+} vout_display_sys_t;
 static void            Display(vout_display_t *, picture_t *);
 static int             Control(vout_display_t *, int);
 


=====================================
modules/video_output/kms.c
=====================================
@@ -67,7 +67,7 @@
 
 typedef enum { drvSuccess, drvTryNext, drvFail } deviceRval;
 
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
 /*
  * buffer information
  */
@@ -99,7 +99,7 @@ struct vout_display_sys_t {
  * other generic stuff
  */
     int             drm_fd;
-};
+} vout_display_sys_t;
 
 static void DestroyFB(vout_display_sys_t const *sys, uint32_t const buf)
 {


=====================================
modules/video_output/kva.c
=====================================
@@ -80,7 +80,7 @@ vlc_module_end ()
  * This structure is part of the video output thread descriptor.
  * It describes the module specific properties of an output thread.
  *****************************************************************************/
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     TID                tid;
     HEV                ack_event;
@@ -102,7 +102,7 @@ struct vout_display_sys_t
     ULONG              cursor_timeout;
 
     int                i_chroma_shift;
-};
+} vout_display_sys_t;
 
 /*****************************************************************************
  * Local prototypes
@@ -820,21 +820,25 @@ static MRESULT EXPENTRY MyFrameWndProc( HWND hwnd, ULONG msg, MPARAM mp1,
 
 static void MousePressed( vout_display_t *vd, HWND hwnd, unsigned button )
 {
+    vout_display_sys_t *sys = vd->sys;
+
     if( WinQueryFocus( HWND_DESKTOP ) != hwnd )
         WinSetFocus( HWND_DESKTOP, hwnd );
 
-    if( !vd->sys->button_pressed )
+    if( !sys->button_pressed )
         WinSetCapture( HWND_DESKTOP, hwnd );
 
-    vd->sys->button_pressed |= 1 << button;
+    sys->button_pressed |= 1 << button;
 
     vout_window_ReportMousePressed( vd->cfg->window, button );
 }
 
 static void MouseReleased( vout_display_t *vd, unsigned button )
 {
-    vd->sys->button_pressed &= ~(1 << button);
-    if( !vd->sys->button_pressed )
+    vout_display_sys_t *sys = vd->sys;
+
+    sys->button_pressed &= ~(1 << button);
+    if( !sys->button_pressed )
         WinSetCapture( HWND_DESKTOP, NULLHANDLE );
 
     vout_window_ReportMouseReleased( vd->cfg->window, button );


=====================================
modules/video_output/libplacebo/display.c
=====================================
@@ -43,7 +43,7 @@
 # include <libplacebo/shaders/lut.h>
 #endif
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vlc_placebo_t *pl;
     const struct pl_tex *plane_tex[4];
@@ -79,7 +79,7 @@ struct vout_display_sys_t
     const struct pl_hook *hook;
     char *hook_path;
 #endif
-};
+} vout_display_sys_t;
 
 // Display callbacks
 static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, mtime_t);


=====================================
modules/video_output/macosx.m
=====================================
@@ -103,7 +103,7 @@ vlc_module_end ()
 @end
 
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     VLCOpenGLVideoView *glView;
     id<VLCVideoViewEmbedding> container;
@@ -116,7 +116,7 @@ struct vout_display_sys_t
     bool has_first_frame;
 
     vout_display_cfg_t cfg;
-};
+} vout_display_sys_t;
 
 struct gl_sys
 {
@@ -329,7 +329,7 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic)
         if (@available(macOS 10.14, *)) {
             vout_display_place_t place;
             vout_display_PlacePicture(&place, vd->source, &sys->cfg);
-            vout_display_opengl_Viewport(vd->sys->vgl, place.x,
+            vout_display_opengl_Viewport(sys->vgl, place.x,
                                          sys->cfg.display.height - (place.y + place.height),
                                          place.width, place.height);
         }
@@ -555,8 +555,10 @@ static void OpenglSwap (vlc_gl_t *gl)
     VLCAssertMainThread();
 
     @synchronized(self) {
-        BOOL hasFirstFrame = vd && vd->sys->has_first_frame;
-        return !_hasPendingReshape && hasFirstFrame;
+        if (!vd)
+            return false;
+        vout_display_sys_t *sys = vd->sys;
+        return !_hasPendingReshape && sys->has_first_frame;
     }
 }
 
@@ -596,14 +598,17 @@ static void OpenglSwap (vlc_gl_t *gl)
     if ([self canSkipRendering])
         return;
 
+    vout_display_sys_t *sys;
+
     BOOL hasFirstFrame;
     @synchronized(self) { // vd can be accessed from multiple threads
-        hasFirstFrame = vd && vd->sys->has_first_frame;
+        sys = vd ? vd->sys : NULL;
+        hasFirstFrame = sys && sys->has_first_frame;
     }
 
     if (hasFirstFrame)
         // This will lock gl.
-        vout_display_opengl_Display(vd->sys->vgl);
+        vout_display_opengl_Display(sys->vgl);
     else
         glClear (GL_COLOR_BUFFER_BIT);
 }


=====================================
modules/video_output/opengl/display.c
=====================================
@@ -74,13 +74,13 @@ vlc_module_begin ()
     add_opengl_submodule_draw()
 vlc_module_end ()
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_display_opengl_t *vgl;
     vlc_gl_t *gl;
     vout_display_place_t place;
     bool place_changed;
-};
+} vout_display_sys_t;
 
 /* Display callbacks */
 static void PictureRender (vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);


=====================================
modules/video_output/splitter.c
=====================================
@@ -43,13 +43,13 @@ struct vlc_vidsplit_part {
     unsigned height;
 };
 
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     video_splitter_t splitter;
     vlc_mutex_t lock;
 
     picture_t **pictures;
     struct vlc_vidsplit_part *parts;
-};
+} vout_display_sys_t;
 
 static void vlc_vidsplit_Prepare(vout_display_t *vd, picture_t *pic,
                                  subpicture_t *subpic, vlc_tick_t date)


=====================================
modules/video_output/vgl.c
=====================================
@@ -38,7 +38,7 @@
 #define GL_RGBA 0x1908
 #endif
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     libvlc_video_output_cleanup_cb cleanupCb;
     libvlc_video_output_setup_cb setupCb;
@@ -50,7 +50,7 @@ struct vout_display_sys_t
     void* opaque;
     unsigned width;
     unsigned height;
-};
+} vout_display_sys_t;
 
 
 static void *OurGetProcAddress(vlc_gl_t *gl, const char *name)


=====================================
modules/video_output/vmem.c
=====================================
@@ -83,7 +83,7 @@ typedef struct
 } picture_sys_t;
 
 /* NOTE: the callback prototypes must match those of LibVLC */
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     void *opaque;
     void *pic_opaque;
     void *(*lock)(void *sys, void **plane);
@@ -93,7 +93,7 @@ struct vout_display_sys_t {
 
     unsigned pitches[PICTURE_PLANE_MAX];
     unsigned lines[PICTURE_PLANE_MAX];
-};
+} vout_display_sys_t;
 
 typedef unsigned (*vlc_format_cb)(void **, char *, unsigned *, unsigned *,
                                   unsigned *, unsigned *);


=====================================
modules/video_output/wayland/shm.c
=====================================
@@ -44,7 +44,7 @@
 
 #define MAX_PICTURES 4
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_window_t *embed; /* VLC window */
     struct wl_event_queue *eventq;
@@ -56,7 +56,7 @@ struct vout_display_sys_t
 
     unsigned display_width;
     unsigned display_height;
-};
+} vout_display_sys_t;
 
 struct buffer_data
 {


=====================================
modules/video_output/win32/direct3d11.c
=====================================
@@ -88,7 +88,7 @@ vlc_module_begin ()
     set_callback_display(Open, 300)
 vlc_module_end ()
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_display_sys_win32_t sys;       /* only use if sys.event is not NULL */
     display_win32_area_t     area;
@@ -135,7 +135,7 @@ struct vout_display_sys_t
     libvlc_video_makeCurrent_cb              startEndRenderingCb;
     libvlc_video_frameMetadata_cb            sendMetadataCb;
     libvlc_video_output_select_plane_cb      selectPlaneCb;
-};
+} vout_display_sys_t;
 
 static void Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, vlc_tick_t);
 static void Display(vout_display_t *, picture_t *);
@@ -451,11 +451,13 @@ error:
 
 static void Close(vout_display_t *vd)
 {
-    D3D_ReleaseShaderCompiler(&vd->sys->shaders);
+    vout_display_sys_t *sys = vd->sys;
+
+    D3D_ReleaseShaderCompiler(&sys->shaders);
     Direct3D11Close(vd);
 #if !VLC_WINSTORE_APP
-    UnhookWindowsSensors(vd->sys->p_sensors);
-    CommonWindowClean(&vd->sys->sys);
+    UnhookWindowsSensors(sys->p_sensors);
+    CommonWindowClean(&sys->sys);
 #endif
 }
 static int Control(vout_display_t *vd, int query)
@@ -708,17 +710,21 @@ static void Display(vout_display_t *vd, picture_t *picture)
 
 static const d3d_format_t *GetDirectRenderingFormat(vout_display_t *vd, vlc_fourcc_t i_src_chroma)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD;
     if (is_d3d11_opaque(i_src_chroma))
         supportFlags |= D3D11_FORMAT_SUPPORT_DECODER_OUTPUT;
-    return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0,
+    return FindD3D11Format( vd, sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0,
                             is_d3d11_opaque(i_src_chroma) ? DXGI_CHROMA_GPU : DXGI_CHROMA_CPU, supportFlags );
 }
 
 static const d3d_format_t *GetDirectDecoderFormat(vout_display_t *vd, vlc_fourcc_t i_src_chroma)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     UINT supportFlags = D3D11_FORMAT_SUPPORT_DECODER_OUTPUT;
-    return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0,
+    return FindD3D11Format( vd, sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0,
                             DXGI_CHROMA_GPU, supportFlags );
 }
 
@@ -728,18 +734,22 @@ static const d3d_format_t *GetDisplayFormatByDepth(vout_display_t *vd, uint8_t b
                                                    bool from_processor,
                                                    int rgb_yuv)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD;
     if (from_processor)
         supportFlags |= D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT;
-    return FindD3D11Format( vd, vd->sys->d3d_dev, 0, rgb_yuv,
+    return FindD3D11Format( vd, sys->d3d_dev, 0, rgb_yuv,
                             bit_depth, widthDenominator+1, heightDenominator+1,
                             DXGI_CHROMA_CPU, supportFlags );
 }
 
 static const d3d_format_t *GetBlendableFormat(vout_display_t *vd, vlc_fourcc_t i_src_chroma)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     UINT supportFlags = D3D11_FORMAT_SUPPORT_SHADER_LOAD | D3D11_FORMAT_SUPPORT_BLENDABLE;
-    return FindD3D11Format( vd, vd->sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0, DXGI_CHROMA_CPU, supportFlags );
+    return FindD3D11Format( vd, sys->d3d_dev, i_src_chroma, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT, 0, 0, 0, DXGI_CHROMA_CPU, supportFlags );
 }
 
 static int Direct3D11Open(vout_display_t *vd, video_format_t *fmtp, vlc_video_context *vctx)
@@ -952,6 +962,8 @@ static void Direct3D11Close(vout_display_t *vd)
 
 static bool CanUseTextureArray(vout_display_t *vd)
 {
+    vout_display_sys_t *sys = vd->sys;
+
 #ifndef HAVE_ID3D11VIDEODECODER
     (void) vd;
     return false;
@@ -962,7 +974,7 @@ static bool CanUseTextureArray(vout_display_t *vd)
     struct wddm_version WDDM_os = {
         .wddm         = 21,  // starting with drivers designed for W10 Anniversary Update
     };
-    if (D3D11CheckDriverVersion(vd->sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM_os) != VLC_SUCCESS)
+    if (D3D11CheckDriverVersion(sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM_os) != VLC_SUCCESS)
     {
         msg_Dbg(vd, "AMD driver too old, fallback to legacy shader mode");
         return false;
@@ -972,7 +984,7 @@ static bool CanUseTextureArray(vout_display_t *vd)
     struct wddm_version WDDM_build = {
         .revision     = 162,
     };
-    if (D3D11CheckDriverVersion(vd->sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM_build) != VLC_SUCCESS)
+    if (D3D11CheckDriverVersion(sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM_build) != VLC_SUCCESS)
     {
         msg_Dbg(vd, "Bogus AMD driver detected, fallback to legacy shader mode");
         return false;
@@ -984,10 +996,12 @@ static bool CanUseTextureArray(vout_display_t *vd)
 
 static bool BogusZeroCopy(const vout_display_t *vd)
 {
-    if (vd->sys->d3d_dev->adapterDesc.VendorId != GPU_MANUFACTURER_AMD)
+    vout_display_sys_t *sys = vd->sys;
+
+    if (sys->d3d_dev->adapterDesc.VendorId != GPU_MANUFACTURER_AMD)
         return false;
 
-    switch (vd->sys->d3d_dev->adapterDesc.DeviceId)
+    switch (sys->d3d_dev->adapterDesc.DeviceId)
     {
     case 0x687F: // RX Vega 56/64
     case 0x6863: // RX Vega Frontier Edition
@@ -996,7 +1010,7 @@ static bool BogusZeroCopy(const vout_display_t *vd)
         struct wddm_version WDDM = {
             .revision     = 14011, // 18.10.2 - 2018/06/11
         };
-        return D3D11CheckDriverVersion(vd->sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM) != VLC_SUCCESS;
+        return D3D11CheckDriverVersion(sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM) != VLC_SUCCESS;
     }
     default:
         return false;


=====================================
modules/video_output/win32/direct3d9.c
=====================================
@@ -130,7 +130,7 @@ typedef struct
     uint32_t     bmask;
 } d3d9_format_t;
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_display_sys_win32_t sys;       /* only use if sys.event is not NULL */
     display_win32_area_t     area;
@@ -172,7 +172,7 @@ struct vout_display_sys_t
         HMODULE                 dll;
         IDXVAHD_VideoProcessor *proc;
     } processor;
-};
+} vout_display_sys_t;
 
 /* */
 typedef struct
@@ -485,11 +485,13 @@ static void Direct3D9DestroyShaders(vout_display_t *vd)
  */
 static void Direct3D9DestroyResources(vout_display_t *vd)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     Direct3D9DestroyScene(vd);
-    if (vd->sys->dx_render)
+    if (sys->dx_render)
     {
-        IDirect3DSurface9_Release(vd->sys->dx_render);
-        vd->sys->dx_render = NULL;
+        IDirect3DSurface9_Release(sys->dx_render);
+        sys->dx_render = NULL;
     }
     Direct3D9DestroyShaders(vd);
 }
@@ -1019,7 +1021,7 @@ static int Direct3D9RenderRegion(vout_display_t *vd,
 {
     vout_display_sys_t *sys = vd->sys;
 
-    IDirect3DDevice9 *d3ddev = vd->sys->d3d9_device->d3ddev.dev;
+    IDirect3DDevice9 *d3ddev = sys->d3d9_device->d3ddev.dev;
 
     HRESULT hr;
 
@@ -1895,11 +1897,13 @@ error:
  */
 static void Close(vout_display_t *vd)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     Direct3D9Close(vd);
 
-    CommonWindowClean(&vd->sys->sys);
+    CommonWindowClean(&sys->sys);
 
-    Direct3D9Destroy(vd->sys);
+    Direct3D9Destroy(sys);
 
-    free(vd->sys);
+    free(sys);
 }


=====================================
modules/video_output/win32/glwin32.c
=====================================
@@ -63,7 +63,7 @@ vlc_module_end()
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_display_sys_win32_t sys;
     display_win32_area_t     area;
@@ -73,7 +73,7 @@ struct vout_display_sys_t
 
     /* Sensors */
     void *p_sensors;
-};
+} vout_display_sys_t;
 
 static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void           Display(vout_display_t *, picture_t *);


=====================================
modules/video_output/win32/wgl.c
=====================================
@@ -57,7 +57,7 @@ vlc_module_end()
  * Local prototypes.
  *****************************************************************************/
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     HWND                  hvideownd;
     HDC                   hGLDC;
@@ -71,7 +71,7 @@ struct vout_display_sys_t
         PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
         PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB;
     } exts;
-};
+} vout_display_sys_t;
 
 static void          Swap(vlc_gl_t *);
 static void          *OurGetProcAddress(vlc_gl_t *, const char *);


=====================================
modules/video_output/win32/wingdi.c
=====================================
@@ -58,7 +58,7 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     vout_display_sys_win32_t sys;
     display_win32_area_t     area;
@@ -79,7 +79,7 @@ struct vout_display_sys_t
         RGBQUAD    green;
         RGBQUAD    blue;
     };
-};
+} vout_display_sys_t;
 
 static void           Display(vout_display_t *, picture_t *);
 
@@ -143,9 +143,11 @@ error:
 /* */
 static void Close(vout_display_t *vd)
 {
+    vout_display_sys_t *sys = vd->sys;
+
     Clean(vd);
 
-    CommonWindowClean(&vd->sys->sys);
+    CommonWindowClean(&sys->sys);
 
     free(vd->sys);
 }


=====================================
modules/video_output/xcb/render.c
=====================================
@@ -43,7 +43,7 @@
 #include "pictures.h"
 #include "events.h"
 
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     xcb_connection_t *conn;
 
     struct {
@@ -76,7 +76,7 @@ struct vout_display_sys_t {
     int32_t src_x;
     int32_t src_y;
     vlc_fourcc_t spu_chromas[2];
-};
+} vout_display_sys_t;
 
 static size_t PictureAttach(vout_display_t *vd, picture_t *pic)
 {


=====================================
modules/video_output/xcb/x11.c
=====================================
@@ -38,7 +38,7 @@
 #include "pictures.h"
 #include "events.h"
 
-struct vout_display_sys_t
+typedef struct vout_display_sys_t
 {
     xcb_connection_t *conn;
 
@@ -48,7 +48,7 @@ struct vout_display_sys_t
     bool attached;
     uint8_t depth; /* useful bits per pixel */
     video_format_t fmt;
-};
+} vout_display_sys_t;
 
 static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
                     vlc_tick_t date)


=====================================
modules/video_output/yuv.c
=====================================
@@ -80,11 +80,11 @@ static int            Control(vout_display_t *, int);
 /*****************************************************************************
  * vout_display_sys_t: video output descriptor
  *****************************************************************************/
-struct vout_display_sys_t {
+typedef struct vout_display_sys_t {
     FILE *f;
     bool  is_first;
     bool  is_yuv4mpeg2;
-};
+} vout_display_sys_t;
 
 static const struct vlc_display_operations ops = {
     Close, NULL, Display, Control, NULL, NULL,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3af1b9dc30bcf6e378d81fc1229bd3f8ad3bf363

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3af1b9dc30bcf6e378d81fc1229bd3f8ad3bf363
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list