blob: 0a06540fb47da9aa09a895fd48b3ce0bbd5f2cc1 [file] [log] [blame]
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001From cde31d23c071ee93fae96331805f696856084254 Mon Sep 17 00:00:00 2001
2From: "U. Artie Eoff" <ullysses.a.eoff@intel.com>
3Date: Mon, 13 Feb 2023 17:02:01 -0500
4Subject: [PATCH] avviddec: change
5 AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS
6
7This fixes a compile error with recent upstream FFmpeg.
8
9The AV_CODEC_CAP_AUTO_THREADS was deprecated and renamed to
10AV_CODEC_CAP_OTHER_THREADS in FFmpeg upstream commit
117d09579190de (lavc 58.132.100).
12
13The AV_CODEC_CAP_AUTO_THREADS was finally removed in FFmpeg upstream
14commit 10c9a0874cb3 (lavc 59.63.100).
15
16Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3964>
17
18Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/cde31d23c071ee93fae96331805f696856084254?merge_request_iid=3964]
19Signed-off-by: Alexander Kanavin <alex@linutronix.de>
20---
21 ext/libav/gstavviddec.c | 6 +++++-
22 1 file changed, 5 insertions(+), 1 deletion(-)
23
24diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
25index 43cea456ae8..6d7c4cd0de8 100644
26--- a/ext/libav/gstavviddec.c
27+++ b/ext/libav/gstavviddec.c
28@@ -35,6 +35,10 @@
29
30 GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
31
32+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100)
33+#define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS
34+#endif
35+
36 #define GST_FFMPEG_VIDEO_CODEC_FRAME_FLAG_ALLOCATED (1<<15)
37
38 #define MAX_TS_MASK 0xff
39@@ -615,7 +619,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder,
40 if (ffmpegdec->max_threads == 0) {
41 /* When thread type is FF_THREAD_FRAME, extra latency is introduced equal
42 * to one frame per thread. We thus need to calculate the thread count ourselves */
43- if ((!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS)) ||
44+ if ((!(oclass->in_plugin->capabilities & AV_CODEC_CAP_OTHER_THREADS)) ||
45 (ffmpegdec->context->thread_type & FF_THREAD_FRAME))
46 ffmpegdec->context->thread_count =
47 MIN (gst_ffmpeg_auto_max_threads (), 16);
48--
49GitLab