[vlc-devel] [PATCH 44/48] vaapi: create a dummy video context

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 11 15:35:17 CEST 2019


---
 modules/codec/avcodec/vaapi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index ef003cf3819..d6fd893b454 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -51,6 +51,7 @@
 struct vlc_va_sys_t
 {
     struct vaapi_context hw_ctx;
+    vlc_video_context *vctx;
     /* mimick what is done in the decoder pool from the display for now */
     picture_pool_t *picture_pool;
 };
@@ -139,6 +140,7 @@ static void Delete(vlc_va_t *va)
     vlc_object_t *o = VLC_OBJECT(va);
 
     picture_pool_Release(sys->picture_pool);
+    vlc_video_context_Release(sys->vctx);
     vlc_vaapi_DestroyContext(o, sys->hw_ctx.display, sys->hw_ctx.context_id);
     vlc_vaapi_DestroyConfig(o, sys->hw_ctx.display, sys->hw_ctx.config_id);
     free(sys);
@@ -204,9 +206,14 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *d
 
     msg_Info(va, "Using %s", vaQueryVendorString(sys->hw_ctx.display));
 
+    sys->vctx = vlc_video_context_Create( dec_device, VLC_VIDEO_CONTEXT_VAAPI, 0, NULL );
+    if (sys->vctx == NULL)
+        goto error;
+
     ctx->hwaccel_context = &sys->hw_ctx;
     va->sys = sys;
     va->ops = &ops;
+    *vtcx_out = sys->vctx;
     return VLC_SUCCESS;
 
 error:
-- 
2.17.1



More information about the vlc-devel mailing list