Skip to content

[3.0.x] VAAPI support is broken after FFmpeg 5.0

  1. The header file libavcodec/vaapi.h has been removed, which caused build failure.
commit e3d993fab0ad4255dffd10a794fc5e1bd37047b7
Author: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Date:   Fri Feb 26 09:37:37 2021 +0100

    avcodec/vaapi: Remove old and deprecated VAAPI context and header

    Deprecated in 851960f6f8cf1f946fe42fa36cf6598fac68072c.
  1. The support of avctx->hwaccel_context has been removed in the same commit, which leads to runtime failure.
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 57a0eb4e6e..958ddf49da 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -640,46 +640,6 @@ int ff_vaapi_decode_init(AVCodecContext *avctx)
     ctx->va_config  = VA_INVALID_ID;
     ctx->va_context = VA_INVALID_ID;

-#if FF_API_STRUCT_VAAPI_CONTEXT
-    if (avctx->hwaccel_context) {
-        av_log(avctx, AV_LOG_WARNING, "Using deprecated struct "
-               "vaapi_context in decode.\n");
-
-        ctx->have_old_context = 1;
-        ctx->old_context = avctx->hwaccel_context;
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information