[vlc-commits] [Git][videolan/vlc][master] avcodec: va: make sys a void pointer

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jul 10 09:22:41 UTC 2021



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


Commits:
bd8359f3 by Thomas Guillem at 2021-07-10T09:06:46+00:00
avcodec: va: make sys a void pointer

The concrete sys type is local to each module.

- - - - -


5 changed files:

- modules/codec/avcodec/d3d11va.c
- modules/codec/avcodec/dxva2.c
- modules/codec/avcodec/va.h
- modules/codec/avcodec/vaapi.c
- modules/hw/vdpau/avcodec.c


Changes:

=====================================
modules/codec/avcodec/d3d11va.c
=====================================
@@ -74,7 +74,7 @@ vlc_module_end()
 #include <initguid.h> /* must be last included to not redefine existing GUIDs */
 DEFINE_GUID(DXVA2_NoEncrypt,                        0x1b81bed0, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
 
-struct vlc_va_sys_t
+typedef struct
 {
     d3d11_device_t               *d3d_dev;
 
@@ -94,7 +94,7 @@ struct vlc_va_sys_t
     va_pool_t                     *va_pool;
     ID3D11VideoDecoderOutputView  *hw_surface[MAX_SURFACE_COUNT];
     ID3D11ShaderResourceView      *renderSrc[MAX_SURFACE_COUNT * DXGI_MAX_SHADER_VIEW];
-};
+} vlc_va_sys_t;
 
 /* */
 static int D3dCreateDevice(vlc_va_t *);
@@ -400,17 +400,17 @@ static int DxSetupOutput(vlc_va_t *va, const directx_va_mode_t *mode, const vide
     int idx = 0;
     const d3d_format_t *decoder_format;
     UINT supportFlags = D3D11_FORMAT_SUPPORT_DECODER_OUTPUT | D3D11_FORMAT_SUPPORT_SHADER_LOAD;
-    decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+    decoder_format = FindD3D11Format( va, sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
                                       mode->bit_depth, mode->log2_chroma_h+1, mode->log2_chroma_w+1,
                                       DXGI_CHROMA_GPU, supportFlags );
     if (decoder_format == NULL)
-        decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+        decoder_format = FindD3D11Format( va, sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
                                         mode->bit_depth, 0, 0, DXGI_CHROMA_GPU, supportFlags );
     if (decoder_format == NULL && mode->bit_depth > 10)
-        decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+        decoder_format = FindD3D11Format( va, sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
                                         10, 0, 0, DXGI_CHROMA_GPU, supportFlags );
     if (decoder_format == NULL)
-        decoder_format = FindD3D11Format( va, va->sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
+        decoder_format = FindD3D11Format( va, sys->d3d_dev, 0, DXGI_RGB_FORMAT|DXGI_YUV_FORMAT,
                                         0, 0, 0, DXGI_CHROMA_GPU, supportFlags );
     if (decoder_format != NULL)
     {


=====================================
modules/codec/avcodec/dxva2.c
=====================================
@@ -92,7 +92,7 @@ static const d3d9_format_t *D3dFindFormat(D3DFORMAT format)
     return NULL;
 }
 
-struct vlc_va_sys_t
+typedef struct
 {
     /* Direct3D */
     vlc_video_context      *vctx;
@@ -118,7 +118,7 @@ struct vlc_va_sys_t
 
     /* avcodec internals */
     struct dxva_context hw;
-};
+} vlc_va_sys_t;
 
 
 /* */


=====================================
modules/codec/avcodec/va.h
=====================================
@@ -27,7 +27,6 @@
 #include <libavutil/pixdesc.h>
 
 typedef struct vlc_va_t vlc_va_t;
-typedef struct vlc_va_sys_t vlc_va_sys_t;
 typedef struct vlc_decoder_device vlc_decoder_device;
 typedef struct vlc_video_context vlc_video_context;
 
@@ -39,7 +38,7 @@ struct vlc_va_operations {
 struct vlc_va_t {
     struct vlc_object_t obj;
 
-    vlc_va_sys_t *sys;
+    void *sys;
     const struct vlc_va_operations *ops;
 };
 


=====================================
modules/codec/avcodec/vaapi.c
=====================================
@@ -49,13 +49,13 @@
 #include "../../hw/vaapi/vlc_vaapi.h"
 #include "va_surface.h"
 
-struct vlc_va_sys_t
+typedef struct
 {
     struct vaapi_context hw_ctx;
     vlc_video_context *vctx;
     va_pool_t *va_pool;
     VASurfaceID render_targets[MAX_SURFACE_COUNT];
-};
+} vlc_va_sys_t;
 
 static int GetVaProfile(const AVCodecContext *ctx, const es_format_t *fmt_in,
                         VAProfile *va_profile, int *vlc_chroma,


=====================================
modules/hw/vdpau/avcodec.c
=====================================
@@ -40,14 +40,14 @@
 #include "vlc_vdpau.h"
 #include "../../codec/avcodec/va.h"
 
-struct vlc_va_sys_t
+typedef struct
 {
     VdpChromaType type;
     void *hwaccel_context;
     uint32_t width;
     uint32_t height;
     vlc_video_context *vctx;
-};
+} vlc_va_sys_t;
 
 static inline vlc_vdp_video_field_t **GetVDPAUContextPrivate(vlc_video_context *vctx)
 {



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

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




More information about the vlc-commits mailing list