[vlc-devel] [PATCH 08/19] avcodec: vdpau: add a video context similarity check callback

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


---
 modules/hw/vdpau/avcodec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 6f9a75fd803..97253838352 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -152,8 +152,15 @@ static void DestroyVDPAUVideoContext(void *private)
     vdp_release_x11(vctx_priv->vdp);
 }
 
+static bool VDPAUContextSimilar(const vlc_video_context *a, const vlc_video_context *b)
+{
+    struct video_context_private *actx = GetVDPAUContextPrivate( (vlc_video_context *)a );
+    struct video_context_private *bctx = GetVDPAUContextPrivate( (vlc_video_context *)b );
+    return actx->vdp == bctx->vdp;
+}
+
 const struct vlc_video_context_operations vdpau_vctx_ops = {
-    DestroyVDPAUVideoContext, NULL // TODO
+    DestroyVDPAUVideoContext, VDPAUContextSimilar,
 };
 
 static int Open(vlc_va_t *va, AVCodecContext *avctx, const AVPixFmtDescriptor *desc,
-- 
2.17.1



More information about the vlc-devel mailing list