[vlc-devel] [PATCH 33/39] directx_va: stronger typing of va_surface in picture_sys_t

Steve Lhomme robux4 at videolabs.io
Fri Jun 2 16:46:36 CEST 2017


---
 modules/codec/avcodec/directx_va.c | 1 +
 modules/codec/avcodec/directx_va.h | 4 ++--
 modules/video_chroma/d3d11_fmt.h   | 4 +++-
 modules/video_chroma/d3d9_fmt.h    | 4 +++-
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 69de6cf296..9caeb8996d 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -40,6 +40,7 @@
 #define AVVA_DecoderType     IUnknown
 #define AVVA_DecoderDevice   IUnknown
 #define AVVA_DecoderSurface  IUnknown
+typedef struct vlc_va_surface_t vlc_va_surface_t;
 #include "directx_va.h"
 
 #include "avcodec.h"
diff --git a/modules/codec/avcodec/directx_va.h b/modules/codec/avcodec/directx_va.h
index 4a85e78b76..d1ed39b641 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -43,11 +43,11 @@
 #include <stdatomic.h>
 
 /* */
-typedef struct {
+struct vlc_va_surface_t {
     atomic_uintptr_t     refcount;
     picture_t          *p_pic;
     AVVA_DecoderSurface  *decoderSurface;
-} vlc_va_surface_t;
+};
 
 typedef struct input_list_t {
     void (*pf_release)(struct input_list_t *);
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 1ab3977ccd..cf129037e2 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -30,6 +30,8 @@
 
 DEFINE_GUID(GUID_CONTEXT_MUTEX, 0x472e8835, 0x3f8e, 0x4f93, 0xa0, 0xcb, 0x25, 0x79, 0x77, 0x6c, 0xed, 0x86);
 
+typedef struct vlc_va_surface_t vlc_va_surface_t;
+
 /* owned by the vout for VLC_CODEC_D3D11_OPAQUE */
 struct picture_sys_t
 {
@@ -44,7 +46,7 @@ struct picture_sys_t
     ID3D11ShaderResourceView      *resourceView[D3D11_MAX_SHADER_VIEW];
     DXGI_FORMAT                   decoderFormat;
     DXGI_FORMAT                   formatTexture;
-    void                          *va_surface;
+    vlc_va_surface_t              *va_surface;
 };
 
 /* index to use for texture/resource that use a known DXGI format
diff --git a/modules/video_chroma/d3d9_fmt.h b/modules/video_chroma/d3d9_fmt.h
index 8b676d5c26..fdf778dcd9 100644
--- a/modules/video_chroma/d3d9_fmt.h
+++ b/modules/video_chroma/d3d9_fmt.h
@@ -23,11 +23,13 @@
 #ifndef VLC_VIDEOCHROMA_D3D9_FMT_H_
 #define VLC_VIDEOCHROMA_D3D9_FMT_H_
 
+typedef struct vlc_va_surface_t vlc_va_surface_t;
+
 /* owned by the vout for VLC_CODEC_D3D9_OPAQUE */
 struct picture_sys_t
 {
     LPDIRECT3DSURFACE9 surface;
-    void               *va_surface;
+    vlc_va_surface_t              *va_surface;
 };
 
 static inline void ReleasePictureSys(picture_sys_t *p_sys)
-- 
2.12.1



More information about the vlc-devel mailing list