diff --git a/0001-h264vaapi-Use-the-proper-getter-for-getting-the-hard.patch b/0001-h264vaapi-Use-the-proper-getter-for-getting-the-hard.patch new file mode 100644 index 0000000..a0a30c6 --- /dev/null +++ b/0001-h264vaapi-Use-the-proper-getter-for-getting-the-hard.patch @@ -0,0 +1,37 @@ +From 5ff964b62d0112f27b52b742f4e6a054ba9e4732 Mon Sep 17 00:00:00 2001 +From: Arjen Hiemstra +Date: Thu, 3 Oct 2024 10:44:04 +0200 +Subject: [PATCH] h264vaapi: Use the proper getter for getting the hardware + context + +The hw_frames_context was moved out of AVFilterLink for FFmpeg 7.1. +Apparently there is actually a proper getter for getting the +hw_frames_ctx of a filter context, so use that instead so things keep +compiling with 7.1. + +While at it, add a comment explaining why we need this in the first +place. +--- + src/h264vaapiencoder.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/h264vaapiencoder.cpp b/src/h264vaapiencoder.cpp +index 2d610de..cf315f3 100644 +--- a/src/h264vaapiencoder.cpp ++++ b/src/h264vaapiencoder.cpp +@@ -144,7 +144,11 @@ bool H264VAAPIEncoder::initialize(const QSize &size) + // av_dict_set_int(&options, "threads", qMin(16, QThread::idealThreadCount()), 0); + applyEncodingPreference(options); + +- m_avCodecContext->hw_frames_ctx = av_buffer_ref(m_outputFilter->inputs[0]->hw_frames_ctx); ++ // Assign the right hardware context for encoding frames. ++ // We rely on FFmpeg for creating the VAAPI hardware context as part of ++ // `avfilter_graph_parse()`. The codec context needs the VAAPI context to be ++ // able to encode properly, so get that from the output filter. ++ m_avCodecContext->hw_frames_ctx = av_buffer_ref(av_buffersink_get_hw_frames_ctx(m_outputFilter)); + + if (int result = avcodec_open2(m_avCodecContext, codec, &options); result < 0) { + qCWarning(PIPEWIRERECORD_LOGGING) << "Could not open codec" << av_err2str(ret); +-- +2.46.1 + diff --git a/kpipewire6.changes b/kpipewire6.changes index d84b881..4202fd1 100644 --- a/kpipewire6.changes +++ b/kpipewire6.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 3 14:08:29 UTC 2024 - Christophe Marin + +- Add ffmpeg 7.1 compatibility patch: + * 0001-h264vaapi-Use-the-proper-getter-for-getting-the-hard.patch + ------------------------------------------------------------------- Tue Sep 10 14:53:47 UTC 2024 - Fabian Vogt diff --git a/kpipewire6.spec b/kpipewire6.spec index f2033d0..acc5cef 100644 --- a/kpipewire6.spec +++ b/kpipewire6.spec @@ -37,6 +37,8 @@ Source: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{ver Source1: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz.sig Source2: plasma.keyring %endif +# PATCH-FIX-UPSTREAM +Patch0: 0001-h264vaapi-Use-the-proper-getter-for-getting-the-hard.patch BuildRequires: kf6-extra-cmake-modules BuildRequires: pkgconfig BuildRequires: qt6-gui-private-devel >= %{qt6_version}