@ -1,19 +1,22 @@
# To get the gmp-api commit to use, run:
# rm -rf gmp-api;make gmp-bootstrap;cd gmp-api;git rev-parse HEAD
%global commit1 c5f1d0f3213178818cbfb3e16f31d07328980560
%global commit1 e7d30b921df736a1121a0c8e0cf3ab1ce5b8a4b7
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
%global openh264_version 2.1.1
%global gst_version 1.18.2
%global openh264_version 2.4.1
%global gst_version 1.22.9
# Filter out soname provides for the mozilla plugin
%global __provides_exclude_from ^%{_libdir}/mozilla/plugins/
Name: openh264
Version: %{openh264_version}
# Also bump the Release tag for gstreamer1-plugin-openh264 down below
Release: 2 %{?dist}
Release: 1 %{?dist}
Summary: H.264 codec library
License: BSD
URL: http://www.openh264.org/
License: BSD-2-Clause
URL: https ://www.openh264.org/
Source0: https://github.com/cisco/openh264/archive/v%{openh264_version}/openh264-%{openh264_version}.tar.gz
Source1: https://github.com/mozilla/gmp-api/archive/%{commit1}/gmp-api-%{shortcommit1}.tar.gz
# The source is:
@ -22,13 +25,6 @@ Source1: https://github.com/mozilla/gmp-api/archive/%{commit1}/gmp-api-%{
Source2: gst-plugins-bad-openh264-%{gst_version}.tar.xz
Source3: gst-p-bad-cleanup.sh
# Fix build failure with opencv disabled:
# https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1406
# https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1570
Patch0: 0001-examples-only-check-opencv_dep-if-option-is-not-disa.patch
# Fix build failure with va disabled:
Patch1: 0001-No-va-test-when-va-disabled.patch
# Don't use pkg-config for finding openh264 as we are building against an in-tree copy
Patch2: hardcode-openh264-dep.patch
@ -39,6 +35,9 @@ BuildRequires: make
BuildRequires: meson
BuildRequires: nasm
# Replace the stub package
Obsoletes: noopenh264 < 1:0
%description
OpenH264 is a codec library which supports H.264 encoding and decoding. It is
suitable for use in real time applications such as WebRTC.
@ -47,6 +46,8 @@ suitable for use in real time applications such as WebRTC.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{openh264_version}-%{release}
# Replace the stub package
Obsoletes: noopenh264-devel < 1:0
%description devel
The %{name}-devel package contains libraries and header files for
@ -85,20 +86,19 @@ mv gmp-api-%{commit1} gmp-api
# Extract gst-plugins-bad-free archive
tar -xf %{S:2}
pushd gst-plugins-bad-%{gst_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
popd
%build
# Update the makefile with our build options
# Must be done in %%build in order to pick up correct LDFLAGS.
sed -i -e 's|^CFLAGS_OPT=.*$|CFLAGS_OPT=%{optflags}|' Makefile
sed -i -e 's|^PREFIX=.*$|PREFIX=%{_prefix}|' Makefile
sed -i -e 's|^LIBDIR_NAME=.*$|LIBDIR_NAME=%{_lib}|' Makefile
sed -i -e 's|^SHAREDLIB_DIR=.*$|SHAREDLIB_DIR=%{_libdir}|' Makefile
sed -i -e '/^CFLAGS_OPT=/i LDFLAGS=%{__global_ldflags}' Makefile
%build
# First build the openh264 libraries
make %{?_smp_mflags}
@ -108,8 +108,8 @@ make plugin %{?_smp_mflags}
# ... and finally build the gstreamer plugin against the previously built
# openh264 libraries
pushd gst-plugins-bad-%{gst_version}
ln -s ../codec/api/svc wels
CFLAGS="%{build_cflags} -I." \
CFLAGS="%{build_cflags} -I`pwd`/../codec/api" \
CXX FLAGS="%{build_cflags} -I`pwd`/ ../codec/api " \
LDFLAGS="%{build_ldflags} -L`pwd`/.." \
%meson \
--auto-features=disabled \
@ -134,9 +134,21 @@ pref("media.gmp-gmpopenh264.version", "system-installed");
EOF
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
cat > $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/gmpopenh264.sh << EOF
MOZ_GMP_PATH="%{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed"
export MOZ_GMP_PATH
cat > $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/gmpopenh264.sh << 'EOF'
if [[ ":$MOZ_GMP_PATH:" != *":%{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed:"* ]]; then
MOZ_GMP_PATH="${MOZ_GMP_PATH}${MOZ_GMP_PATH:+:}%{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed"
export MOZ_GMP_PATH
fi
EOF
mkdir -p $RPM_BUILD_ROOT%{_datadir}/fish/vendor_conf.d
cat > $RPM_BUILD_ROOT%{_datadir}/fish/vendor_conf.d/gmpopenh264.fish << 'EOF'
set -x --path MOZ_GMP_PATH $MOZ_GMP_PATH
set dir %{_libdir}/mozilla/plugins/gmp-gmpopenh264/system-installed
if not contains $dir $MOZ_GMP_PATH
set -p MOZ_GMP_PATH $dir
end
set -e dir
EOF
# Remove static libraries
@ -197,7 +209,7 @@ popd
%files
%license LICENSE
%doc README.md
%{_libdir}/libopenh264.so.6
%{_libdir}/libopenh264.so.7
%{_libdir}/libopenh264.so.%{openh264_version}
%files devel
@ -212,6 +224,9 @@ popd
%dir %{_libdir}/firefox/defaults/pref
%{_libdir}/firefox/defaults/pref/gmpopenh264.js
%{_libdir}/mozilla/plugins/gmp-gmpopenh264/
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_conf.d
%{_datadir}/fish/vendor_conf.d/gmpopenh264.fish
%files -n gstreamer1-plugin-openh264
%{_datadir}/appdata/*.appdata.xml
@ -219,6 +234,48 @@ popd
%changelog
* Fri Feb 02 2024 Kalev Lember <klember@redhat.com> - 2.4.1-1
- Update to 2.4.1
- Update gstreamer plugin to 1.22.9
* Mon Dec 04 2023 Kalev Lember <klember@redhat.com> - 2.4.0-2
- Fix off by one regression in decoder
- Filter out soname provides for mozilla gmp plugin
* Fri Nov 24 2023 Kalev Lember <klember@redhat.com> - 2.4.0-1
- Update to 2.4.0
- Update gstreamer plugin to 1.22.7
- Obsolete noopenh264 stub package
- Use SPDX license identifiers
* Wed Nov 22 2023 NoisyCoil <noisycoil@tutanota.com> - 2.3.1-4
- Set MOZ_GMP_PATH for fish user shell
- Partially resolves: rhbz#2250527
* Thu Aug 17 2023 Dominik Mierzejewski <dominik@greysector.net> - 2.3.1-3
- Add Mozilla plugin path to MOZ_GMP_PATH instead of overriding unconditionally
- Resolves: rhbz#2225112
* Mon Mar 13 2023 Kalev Lember <klember@redhat.com> - 2.3.1-2
- Update gstreamer plugin to 1.22.1
* Thu Sep 29 2022 Kalev Lember <klember@redhat.com> - 2.3.1-1
- Update to 2.3.1
* Wed Aug 10 2022 Kalev Lember <klember@redhat.com> - 2.3.0-2
- Rebuild
* Mon Aug 01 2022 Kalev Lember <klember@redhat.com> - 2.3.0-1
- Update to 2.3.0
- Update gstreamer plugin to 1.20.3
* Wed Mar 16 2022 David King <amigadave@amigadave.com> - 2.2.0-1
- Update to 2.2.0
- Update gstreamer plugin to 1.20.0
* Tue Sep 07 2021 Kalev Lember <klember@redhat.com> - 2.1.1-3
- Update gstreamer plugin to 1.19.1
* Thu Feb 11 2021 Kalev Lember <klember@redhat.com> - 2.1.1-2
- Update gstreamer plugin to 1.18.2
- Remove totem supplements as totem has recommends on