[vlc-devel] [PATCH 34/39] vaapi: create a dummy video context
Steve Lhomme
robux4 at ycbcr.xyz
Wed Oct 2 16:30:07 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 fb6d96ea16c..d434c21007d 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);
@@ -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, 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