[vlc-devel] [PATCH 05/36] dxa9: implement the hold_device callback for the CPU to GPU filter

Steve Lhomme robux4 at ycbcr.xyz
Thu Nov 21 15:13:56 CET 2019


---
 modules/hw/d3d9/dxa9.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 9c9c07a6609..cd1619be40e 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -194,7 +194,14 @@ static picture_t *NewBuffer(filter_t *p_filter)
     return p_sys->staging;
 }
 
-static filter_t *CreateFilter( vlc_object_t *p_this, const es_format_t *p_fmt_in,
+static vlc_decoder_device * HoldD3D9DecoderDevice(vlc_object_t *o, void *sys)
+{
+    VLC_UNUSED(o);
+    filter_t *p_this = sys;
+    return filter_HoldDecoderDevice(p_this);
+}
+
+static filter_t *CreateFilter( filter_t *p_this, const es_format_t *p_fmt_in,
                                vlc_fourcc_t dst_chroma )
 {
     filter_t *p_filter;
@@ -203,7 +210,7 @@ static filter_t *CreateFilter( vlc_object_t *p_this, const es_format_t *p_fmt_in
     if (unlikely(p_filter == NULL))
         return NULL;
 
-    static const struct filter_video_callbacks cbs = { NewBuffer, NULL/*TODO*/ };
+    static const struct filter_video_callbacks cbs = { NewBuffer, HoldD3D9DecoderDevice };
     p_filter->b_allow_fmt_out_change = false;
     p_filter->owner.video = &cbs;
     p_filter->owner.sys = p_this;
@@ -426,7 +433,7 @@ int D3D9OpenCPUConverter( vlc_object_t *obj )
         res_sys->surface = texture;
         IDirect3DSurface9_AddRef(texture);
 
-        p_cpu_filter = CreateFilter(VLC_OBJECT(p_filter), &p_filter->fmt_in, p_dst->format.i_chroma);
+        p_cpu_filter = CreateFilter(p_filter, &p_filter->fmt_in, p_dst->format.i_chroma);
         if (!p_cpu_filter)
             goto done;
     }
-- 
2.17.1



More information about the vlc-devel mailing list