31 Commits

Author SHA256 Message Date
52f95e9110 Update changelog to add CVE fix entry for CVE-2024-36618 CVE-2024-36617 CVE-2024-36616 CVE-2024-36619 CVE-2024-36615 2025-05-28 19:52:56 +08:00
7ec55b5f78 Reorder user-facing changelog to be in sequence
References: https://bugzilla.opensuse.org/1242310
2025-05-06 03:05:17 +02:00
a150aa6c2e Add bugID recored in n7.1.1 log. With this, maintiance team will allow to submit Factory source to SLE. Avoid bug fix lost. Also fix some old grammar typos. 2025-04-16 13:49:58 +08:00
f281b98b9b Revert "Build with OpenVINO support in libavfilter"
This reverts commit ce60e9ed66.

Too many build-time dependencies.
2025-04-04 11:34:44 +02:00
5f822c5560 Bump mini's version 2025-04-02 02:07:52 +02:00
10630669eb ffmpeg 7.1.1 2025-04-02 02:06:23 +02:00
a40564ee7c Fix BcntSync handling 2025-03-27 11:18:53 +01:00
09f8124ff4 Disable openvino on 32-bit 2025-03-26 21:25:23 +01:00
b1d5de540b Merge 'refs/pull/13/head' 2025-03-25 22:11:38 +01:00
10be3a7196 Add ffmpeg-7-CVE-2025-1816.patch: Backporting 0526535c from upstream, add missing constrains for num_parameters in audio_element_oub(). (CVE-2025-1816, bsc#1238728) and add some lost CVE bugID into the changelog. 2025-03-24 14:32:47 +08:00
ce60e9ed66 Build with OpenVINO support in libavfilter 2025-03-24 00:25:11 +01:00
d27a94528c Add 0001-avcodec-libsvtav1-unbreak-build-with-latest-svtav1.patch 2025-03-05 10:46:17 +01:00
40e49d492e Add security fix record on the update history. (CVE-2024-35368, bsc#1234028) 2025-03-01 20:13:07 +08:00
fba0c8d5ae Add BcntSyncTag directive 2025-02-24 14:06:39 +01:00
90e1a4148e Add 4 patches for 8 CVEs
* CVE-2024-12361
* CVE-2024-35365
* CVE-2024-36613
* CVE-2025-0518
* CVE-2025-22919
* CVE-2025-22920
* CVE-2025-22921
* CVE-2025-25473
2025-02-23 21:23:54 +01:00
32cbe46280 Adjust bconds to build the package in SLFO without xvidcore. 2024-10-15 11:02:13 +02:00
d30cb95aec ffmpeg 7.1 2024-10-02 10:32:42 +02:00
Olaf Hering
e2cfa392ea avcodec/decode: clean-up if get_hw_frames_parameters fails (ffmpeg#11013, vlc#28811)
Signed-off-by: Olaf Hering <olaf@aepfle.de>
2024-09-30 12:34:56 +00:00
Stefan Dirsch
47633c77ba no longer build against libmfx; build also 15.5 against libvpl 2024-09-26 12:23:18 +02:00
baf5b4d954 Add use 64bit for input size check log entry for n7.0.2's update, to record security fix position. (CVE-2024-7055, bsc#1229026) 2024-09-18 10:05:51 +02:00
f803df26e3 Add 0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch (armv7 build fix) 2024-08-21 12:12:29 +02:00
62e69514f7 Delete unreferenced patches 2024-08-10 10:05:05 +02:00
c18297e308 Copy first preamble to second preamble 2024-08-10 00:56:47 +02:00
ab72df490f Delete unreferenced patches 2024-08-08 19:27:36 +02:00
c33511409d Update to release-7.0.2, Drop patches merged by the update. 2024-08-08 18:09:14 +08:00
8c17f41823 Add ffmpeg-7-fix-crashes.patch: Backporting 5b87869c from upstream, fix track handling when mixing IAMF and video tracks, Fixes crashes when muxing the two together. 2024-08-05 16:57:32 +08:00
c11c165366 Merge branch 'refs/pull/2/head' 2024-08-01 05:24:57 +02:00
d213111022 Correct a bug numbers typo. 2024-08-01 10:51:46 +08:00
99ea9689b9 restore deleted metadata 2024-07-27 08:45:16 +02:00
cfe0711bad Add ffmpeg-7-CVE-2024-32228.patch, ffmpeg-7-CVE-2024-32229.patch, ffmpeg-7-CVE-2024-32230.patch to fix CVE issues. 2024-07-25 18:17:40 +08:00
5866842008 Synchronize with OBS 2024-07-09 16:02:33 +02:00
3 changed files with 361 additions and 21 deletions

View File

@@ -1,14 +1,3 @@
-------------------------------------------------------------------
Wed Jun 25 08:40:15 UTC 2025 - Yifan Jiang <yfjiang@suse.com>
- Built with noopenh264, drop ffmpeg-dlopen-openh264.patch
(jsc#PED-12607)
-------------------------------------------------------------------
Thu Jun 12 17:48:49 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
- Enable libiec61883 integration [boo#1244453]
-------------------------------------------------------------------
Fri Apr 4 09:34:14 UTC 2025 - Jan Engelhardt <jengelh@inai.de>

View File

@@ -118,14 +118,16 @@ Patch3: ffmpeg-codec-choice.diff
Patch4: ffmpeg-4.2-dlopen-fdk_aac.patch
Patch5: work-around-abi-break.patch
Patch10: ffmpeg-chromium.patch
Patch91: ffmpeg-dlopen-openh264.patch
Patch15: 11013-avcodec-decode-clean-up-if-get_hw_frames_parameters-.patch
Patch18: ffmpeg-7-CVE-2025-25473.patch
Patch19: ffmpeg-7-CVE-2025-22921.patch
Patch20: 0001-avcodec-libsvtav1-unbreak-build-with-latest-svtav1.patch
BuildRequires: ladspa-devel
BuildRequires: libgsm-devel
BuildRequires: libmp3lame-devel >= 3.98.3
BuildRequires: nasm
BuildRequires: pkg-config
BuildRequires: pkgconfig
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(aom) >= 1.0.0
BuildRequires: pkgconfig(dav1d) >= 0.5.0
@@ -136,7 +138,6 @@ BuildRequires: pkgconfig(fribidi) >= 0.19.0
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(jack)
BuildRequires: pkgconfig(libass) >= 0.11.0
BuildRequires: pkgconfig(libavc1394)
BuildRequires: pkgconfig(libbluray)
BuildRequires: pkgconfig(libbs2b)
BuildRequires: pkgconfig(libcdio)
@@ -144,8 +145,6 @@ BuildRequires: pkgconfig(libcdio_paranoia)
BuildRequires: pkgconfig(libdc1394-2)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libgme)
BuildRequires: pkgconfig(libiec61883)
BuildRequires: pkgconfig(libmp3lame) >= 3.98.3
BuildRequires: pkgconfig(libopenjp2) >= 2.1.0
BuildRequires: pkgconfig(libopenmpt) >= 0.2.6557
BuildRequires: pkgconfig(libpng)
@@ -162,7 +161,6 @@ BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libzmq) >= 4.2.1
BuildRequires: pkgconfig(lilv-0)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(openh264)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(sdl2) >= 2.0.1
BuildRequires: pkgconfig(soxr)
@@ -187,7 +185,7 @@ BuildRequires: pkgconfig(zvbi-0.2) >= 0.2.28
BuildRequires: AMF-devel
%endif
%if %{with mysofa}
BuildRequires: pkgconfig(libmysofa)
BuildRequires: libmysofa-devel
%endif
%if %{with codec2}
BuildRequires: pkgconfig(codec2)
@@ -238,7 +236,7 @@ BuildRequires: pkgconfig(SvtAv1Enc) >= 0.9.0
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600
BuildRequires: pkgconfig(libplacebo) >= 6.292.0
%else
BuildRequires: (pkgconfig(libplacebo) >= 4.192.0 with pkgconfig(libplacebo) < 6.292.0)
BuildRequires: (pkgconfig(libplacebo) >= 4.192.0 with pkgconfig (libplacebo) < 6.292.0)
%endif
BuildRequires: pkgconfig(shaderc) >= 2019.1
BuildRequires: pkgconfig(vulkan) >= 1.3.255
@@ -592,7 +590,6 @@ LDFLAGS="%_lto_cflags" \
--enable-libfreetype \
--enable-libfribidi \
--enable-libgsm \
--enable-libiec61883 \
--enable-libjack \
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700
--enable-libjxl \
@@ -604,7 +601,7 @@ LDFLAGS="%_lto_cflags" \
%endif
--enable-libopenjpeg \
--enable-libopenmpt \
--enable-libopenh264 \
--enable-libopenh264-dlopen \
--enable-libopus \
--enable-libpulse \
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
@@ -835,9 +832,9 @@ Patch3: ffmpeg-codec-choice.diff
Patch4: ffmpeg-4.2-dlopen-fdk_aac.patch
Patch5: work-around-abi-break.patch
Patch10: ffmpeg-chromium.patch
Patch91: ffmpeg-dlopen-openh264.patch
Patch15: 11013-avcodec-decode-clean-up-if-get_hw_frames_parameters-.patch
BuildRequires: c_compiler
BuildRequires: pkgconfig(openh264)
Requires: this-is-only-for-build-envs
%description

View File

@@ -0,0 +1,354 @@
From 4739b0c97b3378bdaf737171777fe9a71a53eff1 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa@fedoraproject.org>
Date: Wed, 12 Oct 2022 09:41:27 -0400
Subject: [PATCH] avcodec/openh264: Add the ability to dlopen() OpenH264
We can't directly depend on OpenH264, but we can weakly link to it
and gracefully expose the capability.
Co-authored-by: Andreas Schneider <asn@cryptomilk.org>
Co-authored-by: Neal Gompa <ngompa@fedoraproject.org>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Signed-off-by: Neal Gompa <ngompa@fedoraproject.org>
---
configure | 3
libavcodec/Makefile | 1
libavcodec/libopenh264.c | 5 +
libavcodec/libopenh264_dlopen.c | 147 ++++++++++++++++++++++++++++++++++++++++
libavcodec/libopenh264_dlopen.h | 58 +++++++++++++++
libavcodec/libopenh264dec.c | 8 ++
libavcodec/libopenh264enc.c | 8 ++
7 files changed, 230 insertions(+)
create mode 100644 libavcodec/libopenh264_dlopen.c
create mode 100644 libavcodec/libopenh264_dlopen.h
Index: ffmpeg-7.1/configure
===================================================================
--- ffmpeg-7.1.orig/configure
+++ ffmpeg-7.1/configure
@@ -255,6 +255,7 @@ External library support:
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenh264 enable H.264 encoding via OpenH264 [no]
+ --enable-libopenh264-dlopen enable H.264 encoding via dlopen()'ed OpenH264 [no]
--enable-libopenjpeg enable JPEG 2000 encoding via OpenJPEG [no]
--enable-libopenmpt enable decoding tracked files via libopenmpt [no]
--enable-libopenvino enable OpenVINO as a DNN module backend
@@ -1939,6 +1940,7 @@ EXTERNAL_LIBRARY_LIST="
libmysofa
libopencv
libopenh264
+ libopenh264_dlopen
libopenjpeg
libopenmpt
libopenvino
@@ -6966,6 +6968,7 @@ enabled libopencv && { check_hea
require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
+enabled libopenh264_dlopen && enable libopenh264 && add_cppflags "-I$(dirname $(readlink -f "$0"))/ffdlopenhdrs/include -DCONFIG_LIBOPENH264_DLOPEN=1"
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
{ require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
Index: ffmpeg-7.1/libavcodec/Makefile
===================================================================
--- ffmpeg-7.1.orig/libavcodec/Makefile
+++ ffmpeg-7.1/libavcodec/Makefile
@@ -1138,6 +1138,7 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER)
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
+OBJS-$(CONFIG_LIBOPENH264_DLOPEN) += libopenh264_dlopen.o
OBJS-$(CONFIG_LIBOPENH264_DECODER) += libopenh264dec.o libopenh264.o
OBJS-$(CONFIG_LIBOPENH264_ENCODER) += libopenh264enc.o libopenh264.o
OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o
Index: ffmpeg-7.1/libavcodec/libopenh264.c
===================================================================
--- ffmpeg-7.1.orig/libavcodec/libopenh264.c
+++ ffmpeg-7.1/libavcodec/libopenh264.c
@@ -20,8 +20,13 @@
*/
#include <string.h>
+
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+#include "libopenh264_dlopen.h"
+#else
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
+#endif
#include "libavutil/error.h"
#include "libavutil/log.h"
Index: ffmpeg-7.1/libavcodec/libopenh264_dlopen.c
===================================================================
--- /dev/null
+++ ffmpeg-7.1/libavcodec/libopenh264_dlopen.c
@@ -0,0 +1,147 @@
+/*
+ * OpenH264 dlopen code
+ *
+ * Copyright (C) 2022 Andreas Schneider <asn@cryptomilk.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <dlfcn.h>
+
+#include "libopenh264_dlopen.h"
+
+/*
+ * The symbol binding makes sure we do not run into strict aliasing issues which
+ * can lead into segfaults.
+ */
+typedef int (*__oh264_WelsCreateSVCEncoder)(ISVCEncoder **);
+typedef void (*__oh264_WelsDestroySVCEncoder)(ISVCEncoder *);
+typedef int (*__oh264_WelsGetDecoderCapability)(SDecoderCapability *);
+typedef long (*__oh264_WelsCreateDecoder)(ISVCDecoder **);
+typedef void (*__oh264_WelsDestroyDecoder)(ISVCDecoder *);
+typedef OpenH264Version (*__oh264_WelsGetCodecVersion)(void);
+typedef void (*__oh264_WelsGetCodecVersionEx)(OpenH264Version *);
+
+#define OH264_SYMBOL_ENTRY(i) \
+ union { \
+ __oh264_##i f; \
+ void *obj; \
+ } _oh264_##i
+
+struct oh264_symbols {
+ OH264_SYMBOL_ENTRY(WelsCreateSVCEncoder);
+ OH264_SYMBOL_ENTRY(WelsDestroySVCEncoder);
+ OH264_SYMBOL_ENTRY(WelsGetDecoderCapability);
+ OH264_SYMBOL_ENTRY(WelsCreateDecoder);
+ OH264_SYMBOL_ENTRY(WelsDestroyDecoder);
+ OH264_SYMBOL_ENTRY(WelsGetCodecVersion);
+ OH264_SYMBOL_ENTRY(WelsGetCodecVersionEx);
+};
+
+/* Symbols are bound by loadLibOpenH264() */
+static struct oh264_symbols openh264_symbols;
+
+int oh264_WelsCreateSVCEncoder(ISVCEncoder **ppEncoder) {
+ return openh264_symbols._oh264_WelsCreateSVCEncoder.f(ppEncoder);
+}
+
+void oh264_WelsDestroySVCEncoder(ISVCEncoder *pEncoder) {
+ return openh264_symbols._oh264_WelsDestroySVCEncoder.f(pEncoder);
+}
+
+int oh264_WelsGetDecoderCapability(SDecoderCapability *pDecCapability) {
+ return openh264_symbols._oh264_WelsGetDecoderCapability.f(pDecCapability);
+}
+
+long oh264_WelsCreateDecoder(ISVCDecoder **ppDecoder) {
+ return openh264_symbols._oh264_WelsCreateDecoder.f(ppDecoder);
+}
+
+void oh264_WelsDestroyDecoder(ISVCDecoder *pDecoder) {
+ return openh264_symbols._oh264_WelsDestroyDecoder.f(pDecoder);
+}
+
+OpenH264Version oh264_WelsGetCodecVersion(void) {
+ return openh264_symbols._oh264_WelsGetCodecVersion.f();
+}
+
+void oh264_WelsGetCodecVersionEx(OpenH264Version *pVersion) {
+ openh264_symbols._oh264_WelsGetCodecVersionEx.f(pVersion);
+}
+
+static void *_oh264_bind_symbol(AVCodecContext *avctx,
+ void *handle,
+ const char *sym_name) {
+ void *sym = NULL;
+
+ sym = dlsym(handle, sym_name);
+ if (sym == NULL) {
+ const char *err = dlerror();
+ av_log(avctx,
+ AV_LOG_WARNING,
+ "%s: Failed to bind %s\n",
+ err,
+ sym_name);
+ return NULL;
+ }
+
+ return sym;
+}
+
+#define oh264_bind_symbol(avctx, handle, sym_name) \
+ if (openh264_symbols._oh264_##sym_name.obj == NULL) { \
+ openh264_symbols._oh264_##sym_name.obj = _oh264_bind_symbol(avctx, handle, #sym_name); \
+ if (openh264_symbols._oh264_##sym_name.obj == NULL) { \
+ return 1; \
+ } \
+ }
+
+int loadLibOpenH264(AVCodecContext *avctx) {
+ static bool initialized = false;
+ void *libopenh264 = NULL;
+ const char *err = NULL;
+
+ if (initialized) {
+ return 0;
+ }
+
+#define OPENH264_LIB "libopenh264.so.7"
+ libopenh264 = dlopen(OPENH264_LIB, RTLD_LAZY);
+ err = dlerror();
+ if (err != NULL) {
+ av_log(avctx, AV_LOG_WARNING,
+ "%s: %s is missing, openh264 support will be disabled\n", err,
+ OPENH264_LIB);
+
+ if (libopenh264 != NULL) {
+ dlclose(libopenh264);
+ }
+ return 1;
+ }
+
+ oh264_bind_symbol(avctx, libopenh264, WelsCreateSVCEncoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsDestroySVCEncoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsGetDecoderCapability);
+ oh264_bind_symbol(avctx, libopenh264, WelsCreateDecoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsDestroyDecoder);
+ oh264_bind_symbol(avctx, libopenh264, WelsGetCodecVersion);
+ oh264_bind_symbol(avctx, libopenh264, WelsGetCodecVersionEx);
+
+ initialized = true;
+
+ return 0;
+}
Index: ffmpeg-7.1/libavcodec/libopenh264_dlopen.h
===================================================================
--- /dev/null
+++ ffmpeg-7.1/libavcodec/libopenh264_dlopen.h
@@ -0,0 +1,58 @@
+/*
+ * OpenH264 dlopen code
+ *
+ * Copyright (C) 2022 Andreas Schneider <asn@cryptomilk.org>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef HAVE_LIBOPENH264_DLOPEN_H
+#define HAVE_LIBOPENH264_DLOPEN_H
+
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+
+#include <wels/codec_api.h>
+#include <wels/codec_ver.h>
+
+#include "avcodec.h"
+
+int oh264_WelsCreateSVCEncoder(ISVCEncoder **ppEncoder);
+#define WelsCreateSVCEncoder oh264_WelsCreateSVCEncoder
+
+void oh264_WelsDestroySVCEncoder(ISVCEncoder *pEncoder);
+#define WelsDestroySVCEncoder oh264_WelsDestroySVCEncoder
+
+int oh264_WelsGetDecoderCapability(SDecoderCapability *pDecCapability);
+#define WelsGetDecoderCapability oh264_WelsGetDecoderCapability
+
+long oh264_WelsCreateDecoder(ISVCDecoder **ppDecoder);
+#define WelsCreateDecoder oh264_WelsCreateDecoder
+
+void oh264_WelsDestroyDecoder(ISVCDecoder *pDecoder);
+#define WelsDestroyDecoder oh264_WelsDestroyDecoder
+
+OpenH264Version oh264_WelsGetCodecVersion(void);
+#define WelsGetCodecVersion oh264_WelsGetCodecVersion
+
+void oh264_WelsGetCodecVersionEx(OpenH264Version *pVersion);
+#define WelsGetCodecVersionEx oh264_WelsGetCodecVersionEx
+
+int loadLibOpenH264(AVCodecContext *avctx);
+
+#endif /* CONFIG_LIBOPENH264_DLOPEN */
+
+#endif /* HAVE_LIBOPENH264_DLOPEN_H */
Index: ffmpeg-7.1/libavcodec/libopenh264dec.c
===================================================================
--- ffmpeg-7.1.orig/libavcodec/libopenh264dec.c
+++ ffmpeg-7.1/libavcodec/libopenh264dec.c
@@ -19,8 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+#include "libopenh264_dlopen.h"
+#else
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
+#endif
#include "libavutil/common.h"
#include "libavutil/fifo.h"
@@ -55,6 +59,10 @@ static av_cold int svc_decode_init(AVCod
int log_level;
WelsTraceCallback callback_function;
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+ if (loadLibOpenH264(avctx))
+ return AVERROR_DECODER_NOT_FOUND;
+#endif
if (WelsCreateDecoder(&s->decoder)) {
av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
return AVERROR_UNKNOWN;
Index: ffmpeg-7.1/libavcodec/libopenh264enc.c
===================================================================
--- ffmpeg-7.1.orig/libavcodec/libopenh264enc.c
+++ ffmpeg-7.1/libavcodec/libopenh264enc.c
@@ -19,8 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+#include "libopenh264_dlopen.h"
+#else
#include <wels/codec_api.h>
#include <wels/codec_ver.h>
+#endif
#include "libavutil/attributes.h"
#include "libavutil/common.h"
@@ -114,6 +118,10 @@ static av_cold int svc_encode_init(AVCod
WelsTraceCallback callback_function;
AVCPBProperties *props;
+#ifdef CONFIG_LIBOPENH264_DLOPEN
+ if (loadLibOpenH264(avctx))
+ return AVERROR_ENCODER_NOT_FOUND;
+#endif
if (WelsCreateSVCEncoder(&s->encoder)) {
av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n");
return AVERROR_UNKNOWN;