From 2e361844faa07a6def58812c3dd8f16c6bb9ec42 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 4 Feb 2019 15:42:46 +0100 Subject: [PATCH] Fix the gst plugin build with openh264 2.0.0 --- ...c-Fix-compilation-with-openh264-v2.0.patch | 30 +++++++++++++++++++ openh264.spec | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 0001-openh264enc-Fix-compilation-with-openh264-v2.0.patch diff --git a/0001-openh264enc-Fix-compilation-with-openh264-v2.0.patch b/0001-openh264enc-Fix-compilation-with-openh264-v2.0.patch new file mode 100644 index 0000000..de05950 --- /dev/null +++ b/0001-openh264enc-Fix-compilation-with-openh264-v2.0.patch @@ -0,0 +1,30 @@ +From d2f6facbfb89f13a891e710b44e1561570de006a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= + +Date: Wed, 8 May 2019 13:35:25 +0200 +Subject: [PATCH] openh264enc: Fix compilation with openh264 v2.0 + +As OpenH264 increased its version to 2.0 the guard for structure +member is not valid. + +This patch will fix the compilation with gst-build and openh264. +--- + ext/openh264/gstopenh264enc.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ext/openh264/gstopenh264enc.cpp b/ext/openh264/gstopenh264enc.cpp +index aa8138d7d..11be2a5b6 100644 +--- a/ext/openh264/gstopenh264enc.cpp ++++ b/ext/openh264/gstopenh264enc.cpp +@@ -739,7 +739,7 @@ gst_openh264enc_set_format (GstVideoEncoder * encoder, + enc_params.bEnableSceneChangeDetect = openh264enc->scene_change_detection; + enc_params.bEnableFrameSkip = openh264enc->enable_frame_skip; + enc_params.bEnableLongTermReference = 0; +-#if OPENH264_MINOR >= 4 ++#if (OPENH264_MAJOR > 1 || (OPENH264_MAJOR == 1 && OPENH264_MINOR >= 4)) + enc_params.eSpsPpsIdStrategy = CONSTANT_ID; + #else + enc_params.bEnableSpsPpsIdAddition = 0; +-- +2.21.0 + diff --git a/openh264.spec b/openh264.spec index 50c53e4..46f48dd 100644 --- a/openh264.spec +++ b/openh264.spec @@ -22,6 +22,9 @@ 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 +# Backported from upstream +Patch0: 0001-openh264enc-Fix-compilation-with-openh264-v2.0.patch + BuildRequires: gcc-c++ BuildRequires: autoconf BuildRequires: chrpath @@ -74,6 +77,9 @@ mv gmp-api-%{commit1} gmp-api # Extract gst-plugins-bad-free archive tar -xf %{S:2} +pushd gst-plugins-bad-%{gst_version} +%patch0 -p1 +popd # Update the makefile with our build options sed -i -e 's|^CFLAGS_OPT=.*$|CFLAGS_OPT=%{optflags}|' Makefile