aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAraz Iusubov <Primeadvice@gmail.com>2024-07-31 15:00:33 -0700
committerDmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>2024-09-04 13:18:41 +0200
commiteda3fc60534c4a30f49c930611d4130427d08ff1 (patch)
treeca4b585ca806747aa92f40a82b47148dae5fe0de
parent9f024085837873e330efc2f2ff73cde21e5af8fd (diff)
downloadffmpeg-eda3fc60534c4a30f49c930611d4130427d08ff1.tar.gz
avcodec/amfenc: GPU driver version check
Implemented gpu driver check. 10-bit patch works incorrectly on driver version lower than 23.30. Signed-off-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
-rw-r--r--libavcodec/amfenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
index 49dd91c4e0..41eaef9758 100644
--- a/libavcodec/amfenc.c
+++ b/libavcodec/amfenc.c
@@ -415,6 +415,10 @@ static int amf_init_encoder(AVCodecContext *avctx)
else
pix_fmt = avctx->pix_fmt;
+ if (pix_fmt == AV_PIX_FMT_P010) {
+ 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");
+ }
+
ctx->format = amf_av_to_amf_format(pix_fmt);
AMF_RETURN_IF_FALSE(ctx, ctx->format != AMF_SURFACE_UNKNOWN, AVERROR(EINVAL),
"Format %s is not supported\n", av_get_pix_fmt_name(pix_fmt));