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

Steve Lhomme robux4 at ycbcr.xyz
Fri Sep 20 16:28:56 CEST 2019


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

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 5402c5fc9dc..b872628e965 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;
 };
@@ -202,9 +203,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