[vlc-devel] [PATCH 07/19] d3d9: add a video context similarity check callback

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 5 16:18:34 CET 2019


---
 modules/video_chroma/d3d9_fmt.c | 2 +-
 modules/video_chroma/d3d9_fmt.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/d3d9_fmt.c b/modules/video_chroma/d3d9_fmt.c
index 3a53484908e..2c399eaed4c 100644
--- a/modules/video_chroma/d3d9_fmt.c
+++ b/modules/video_chroma/d3d9_fmt.c
@@ -293,7 +293,7 @@ static void ReleaseD3D9ContextPrivate(void *private)
 }
 
 const struct vlc_video_context_operations d3d9_vctx_ops = {
-    ReleaseD3D9ContextPrivate, NULL // TODO
+    ReleaseD3D9ContextPrivate, D3D9ContextSimilar,
 };
 
 void d3d9_pic_context_destroy(picture_context_t *ctx)
diff --git a/modules/video_chroma/d3d9_fmt.h b/modules/video_chroma/d3d9_fmt.h
index a04f8956e3e..b6ee7729bd3 100644
--- a/modules/video_chroma/d3d9_fmt.h
+++ b/modules/video_chroma/d3d9_fmt.h
@@ -125,6 +125,13 @@ static inline d3d9_video_context_t *GetD3D9ContextPrivate(vlc_video_context *vct
     return (d3d9_video_context_t *) vlc_video_context_GetPrivate( vctx, VLC_VIDEO_CONTEXT_DXVA2 );
 }
 
+static inline bool D3D9ContextSimilar(const vlc_video_context *a, const vlc_video_context *b)
+{
+    d3d9_video_context_t *actx = GetD3D9ContextPrivate( (vlc_video_context *)a );
+    d3d9_video_context_t *bctx = GetD3D9ContextPrivate( (vlc_video_context *)b );
+    return actx->dev == bctx->dev && actx->format == bctx->format;
+}
+
 static inline void AcquireD3D9PictureSys(picture_sys_d3d9_t *p_sys)
 {
     IDirect3DSurface9_AddRef(p_sys->surface);
-- 
2.17.1



More information about the vlc-devel mailing list