[vlc-devel] [PATCH 02/31] decoder device: the D3D9 device needs to store a IDirect3D9 and an adapter

Steve Lhomme robux4 at ycbcr.xyz
Fri Jul 5 16:19:41 CEST 2019


So we use a structure for that.

Unlike D3D11, the IDirect3D9 isn't tied to an adapter, but to communicate with
external rendering it can only be done on the same adapter they use. So we need
both information.
---
 include/vlc_codec.h             | 2 +-
 modules/video_chroma/d3d9_fmt.h | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 86f092c029..1f0588ee70 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -515,7 +515,7 @@ typedef struct vlc_decoder_device
      * The type of pointer will depend of the type:
      * VAAPI: VADisplay
      * VDPAU: vdp_t *
-     * DXVA2: IDirect3DDevice9*
+     * DXVA2: d3d9_decoder_device_t*
      * D3D11VA: ID3D11DeviceContext*
      * AWindow: android AWindowHandler*
      * MMAL: MMAL_PORT_T*
diff --git a/modules/video_chroma/d3d9_fmt.h b/modules/video_chroma/d3d9_fmt.h
index f35e4414c9..94fe506405 100644
--- a/modules/video_chroma/d3d9_fmt.h
+++ b/modules/video_chroma/d3d9_fmt.h
@@ -66,6 +66,12 @@ typedef struct
     D3DCAPS9                caps;
 } d3d9_device_t;
 
+typedef struct
+{
+    IDirect3D9    *device;
+    int            adapter;
+} d3d9_decoder_device_t;
+
 static inline bool is_d3d9_opaque(vlc_fourcc_t chroma)
 {
     switch (chroma)
-- 
2.17.1



More information about the vlc-devel mailing list