[vlc-devel] [PATCH 30/31] vaapi: create a dummy video context

Steve Lhomme robux4 at ycbcr.xyz
Mon Sep 23 17:03:38 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 5402c5fc9dc..c0acbd70f60 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -52,6 +52,7 @@ struct vlc_va_sys_t
 {
     vlc_decoder_device *dec_device;
     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;
 };
@@ -140,6 +141,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);
     vlc_decoder_device_Release(sys->dec_device);
@@ -202,9 +204,14 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
 
     msg_Info(va, "Using %s", vaQueryVendorString(sys->hw_ctx.display));
 
+    sys->vctx = vlc_video_context_Create( dec_device, 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