From f88d68765e33abdf25ae6ec518548109dc7b69c3 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sun, 12 Mar 2023 17:48:24 -0400 Subject: [PATCH] Patch and rebuild for ffmpeg 6.0 --- ...1d23c071ee93fae96331805f696856084254.patch | 47 +++++++++++++++++++ gstreamer1-plugin-libav.spec | 11 ++++- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 cde31d23c071ee93fae96331805f696856084254.patch diff --git a/cde31d23c071ee93fae96331805f696856084254.patch b/cde31d23c071ee93fae96331805f696856084254.patch new file mode 100644 index 0000000..30d24a6 --- /dev/null +++ b/cde31d23c071ee93fae96331805f696856084254.patch @@ -0,0 +1,47 @@ +From cde31d23c071ee93fae96331805f696856084254 Mon Sep 17 00:00:00 2001 +From: "U. Artie Eoff" +Date: Mon, 13 Feb 2023 17:02:01 -0500 +Subject: [PATCH] avviddec: change + AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS + +This fixes a compile error with recent upstream FFmpeg. + +The AV_CODEC_CAP_AUTO_THREADS was deprecated and renamed to +AV_CODEC_CAP_OTHER_THREADS in FFmpeg upstream commit +7d09579190de (lavc 58.132.100). + +The AV_CODEC_CAP_AUTO_THREADS was finally removed in FFmpeg upstream +commit 10c9a0874cb3 (lavc 59.63.100). + +Part-of: +--- + subprojects/gst-libav/ext/libav/gstavviddec.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/subprojects/gst-libav/ext/libav/gstavviddec.c b/subprojects/gst-libav/ext/libav/gstavviddec.c +index 43cea456ae8..6d7c4cd0de8 100644 +--- a/subprojects/gst-libav/ext/libav/gstavviddec.c ++++ b/subprojects/gst-libav/ext/libav/gstavviddec.c +@@ -35,6 +35,10 @@ + + GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE); + ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100) ++#define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS ++#endif ++ + #define GST_FFMPEG_VIDEO_CODEC_FRAME_FLAG_ALLOCATED (1<<15) + + #define MAX_TS_MASK 0xff +@@ -615,7 +619,7 @@ gst_ffmpegviddec_set_format (GstVideoDecoder * decoder, + if (ffmpegdec->max_threads == 0) { + /* When thread type is FF_THREAD_FRAME, extra latency is introduced equal + * to one frame per thread. We thus need to calculate the thread count ourselves */ +- if ((!(oclass->in_plugin->capabilities & AV_CODEC_CAP_AUTO_THREADS)) || ++ if ((!(oclass->in_plugin->capabilities & AV_CODEC_CAP_OTHER_THREADS)) || + (ffmpegdec->context->thread_type & FF_THREAD_FRAME)) + ffmpegdec->context->thread_count = + MIN (gst_ffmpeg_auto_max_threads (), 16); +-- +GitLab + diff --git a/gstreamer1-plugin-libav.spec b/gstreamer1-plugin-libav.spec index beb31e6..1316502 100644 --- a/gstreamer1-plugin-libav.spec +++ b/gstreamer1-plugin-libav.spec @@ -1,11 +1,15 @@ Name: gstreamer1-plugin-libav Version: 1.22.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GStreamer FFmpeg/LibAV plugin License: LGPLv2+ URL: https://gstreamer.freedesktop.org/ Source0: %{url}/src/gst-libav/gst-libav-%{version}.tar.xz +# Backports from upstream +## Fix build with ffmpeg 6.0+ +Patch0: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/cde31d23c071ee93fae96331805f696856084254.patch + BuildRequires: gcc-c++ BuildRequires: meson BuildRequires: gstreamer1-devel >= %{version} @@ -47,7 +51,7 @@ plugin. %prep -%autosetup -p1 -n gst-libav-%{version} +%autosetup -p3 -n gst-libav-%{version} %build %meson \ @@ -72,6 +76,9 @@ plugin. %endif %changelog +* Sun Mar 12 2023 Neal Gompa - 1.22.0-2 +- Patch and rebuild for ffmpeg 6.0 + * Tue Jan 24 2023 Wim Taymans - 1.22.0-1 - Update to 1.22.0