[FFmpeg-devel] [PATCH 06/10, v2] avcodec/amfenc: GPU driver version check

Dmitrii Ovchinnikov ovchinnikov.dmitrii at gmail.com
Wed May 1 21:38:05 EEST 2024


From: Araz Iusubov <Primeadvice at gmail.com>

Implemented gpu driver check.
10-bit patch works incorrectly on driver version lower than 23.30.

Signed-off-by: Araz Iusubov <Primeadvice at gmail.com>
---
 libavcodec/amfenc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
index 49dd91c4e0..510050e282 100644
--- a/libavcodec/amfenc.c
+++ b/libavcodec/amfenc.c
@@ -558,6 +558,10 @@ int ff_amf_encode_init(AVCodecContext *avctx)
     if ((ret = amf_load_library(avctx)) == 0) {
         if ((ret = amf_init_context(avctx)) == 0) {
             if ((ret = amf_init_encoder(avctx)) == 0) {
+                    if (avctx->pix_fmt == AV_PIX_FMT_P010) {
+                        AmfContext *ctx = avctx->priv_data;
+                        AMF_RETURN_IF_FALSE(ctx, ctx->version >= AMF_MAKE_FULL_VERSION(1, 4, 32, 0), AVERROR_UNKNOWN, "10-bit encoder is not supported by AMD GPU drivers versions lower than 23.30.\n");
+                    }
                 return 0;
             }
         }
-- 
2.38.1.windows.1



More information about the ffmpeg-devel mailing list