summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2019-02-12 12:31:42 +0200
committerMart Raudsepp <leio@gentoo.org>2019-02-12 13:09:42 +0200
commit111c5eb603e3a831e41b810786999aeea5ec6eb0 (patch)
tree60b335f7c595924038811941a8961dea8ce8eb09 /media-plugins
parentx11-themes/gnome-themes-standard: arm64 stable (diff)
downloadgentoo-111c5eb603e3a831e41b810786999aeea5ec6eb0.tar.gz
gentoo-111c5eb603e3a831e41b810786999aeea5ec6eb0.tar.bz2
gentoo-111c5eb603e3a831e41b810786999aeea5ec6eb0.zip
media-plugins/gst-plugins-libav: leak fix; bump bundled ffmpeg used with USE=libav
Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Mart Raudsepp <leio@gentoo.org>
Diffstat (limited to 'media-plugins')
-rw-r--r--media-plugins/gst-plugins-libav/Manifest1
-rw-r--r--media-plugins/gst-plugins-libav/files/AVOptionsRanges-leak-fix.patch34
-rw-r--r--media-plugins/gst-plugins-libav/gst-plugins-libav-1.14.4.4.1.1_p20190113.ebuild103
3 files changed, 138 insertions, 0 deletions
diff --git a/media-plugins/gst-plugins-libav/Manifest b/media-plugins/gst-plugins-libav/Manifest
index acd2008c7145..fcc156cef168 100644
--- a/media-plugins/gst-plugins-libav/Manifest
+++ b/media-plugins/gst-plugins-libav/Manifest
@@ -1,4 +1,5 @@
DIST ffmpeg-3.4.5.tar.bz2 10183082 BLAKE2B f72157baefcd6a0ca8f389309bbe947ad21996e0f2eb3c46c6bfc90f1ebbb14bfd007d001e46ea51efef5db5f9fcee24b1a90b6862136aeebecdc95bb61b23a5 SHA512 e12707d47404a9ce02790b77d2852fc1a1573c8108e980c7355fa48ba891d1649464d4fe4d08394ecd6d871f651ac4388486b7654cb54a7aaeedaf05c55513ec
+DIST ffmpeg-4.1.1.tar.bz2 10686360 BLAKE2B 47f4716d7e184d7318eb1a99ab1cdc188009464e973162e583f7ca4ae79fa3b103f9d5329c8993b72d20667e42e5a749123709a4640f07762568300b5c3c897f SHA512 0241c44e1dffd0d890a3d30a1b2387ea167d578bb39ba0c804fb417e132d343a9e43da9247b205e18b893d8cf75d8528e9971569be67ac380b88618ef0a75ed4
DIST ffmpeg-4.1.tar.bz2 10687291 BLAKE2B 07293af1b13c6c6cad72e368207db21bdbc4b991931166c24ff40b00c3b3c8e1242be1876af8e3f154cc840fcd90d87b762fe77faccf06936dd096478d5d074b SHA512 ccf6d07268dc47e08ca619eb182a003face2a8ee73ec1a28157330dd7de1df88939def1fc1c7e6b6ac7b59752cdad84657d589b2fafb73e14e5ef03fb6e33417
DIST gst-libav-1.14.4-ffmpeg4-patchset.tar.xz 49428 BLAKE2B 74c3e0b25643bcfdf01d1d16514401fef4bb988ba3d1f306b647ba0cd6e89f0205cc33e6d144889d6b2f7fab9e4fae946e03821a85009fa95c68f3cedf25068a SHA512 1347424ed342f00c25ac4780670611a24eeaf708426b6efc6d9f6c6fa7bf91ef292302a5363afe9523c497265b8c0d7ad81374364cbecb2924b749e716819745
DIST gst-libav-1.14.4.tar.xz 9036732 BLAKE2B 1c2e257912f61dac71e1d890f4cb650e0cdbbf4472cbd8dc6b73e471d1914409b71699bd198c154069e15e68364530e91f76619afb52b91e373e58c9237ab7cb SHA512 4a0e9a91c23cba82e6a6b8eb65ff42b9d80389dd232b08c22b3431d3942fb93a6a7e64be97083d11cbceb2abe5d45dc5b37d230f7552e1a7fb193610d0530717
diff --git a/media-plugins/gst-plugins-libav/files/AVOptionsRanges-leak-fix.patch b/media-plugins/gst-plugins-libav/files/AVOptionsRanges-leak-fix.patch
new file mode 100644
index 000000000000..5594dbc1ab80
--- /dev/null
+++ b/media-plugins/gst-plugins-libav/files/AVOptionsRanges-leak-fix.patch
@@ -0,0 +1,34 @@
+From a2c88ec9dadf4a6d7f5f7b16feb2c5c2e155d72d Mon Sep 17 00:00:00 2001
+From: Seungha Yang <seungha.yang@navercorp.com>
+Date: Sun, 13 Jan 2019 00:46:50 +0900
+Subject: [PATCH] avcfg: Fix AVOptionRanges leak
+
+It must be freed with av_opt_freep_ranges as documented.
+---
+ ext/libav/gstavcfg.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
+index 9236078..9d34462 100644
+--- a/ext/libav/gstavcfg.c
++++ b/ext/libav/gstavcfg.c
+@@ -252,10 +252,12 @@ install_opts (GObjectClass * gobject_class, const AVClass ** obj, guint prop_id,
+ if (g_object_class_find_property (gobject_class, name))
+ continue;
+
+- if (av_opt_query_ranges (&r, obj, opt->name, AV_OPT_SEARCH_FAKE_OBJ) >= 0
+- && r->nb_ranges == 1) {
+- min = r->range[0]->value_min;
+- max = r->range[0]->value_max;
++ if (av_opt_query_ranges (&r, obj, opt->name, AV_OPT_SEARCH_FAKE_OBJ) >= 0) {
++ if (r->nb_ranges == 1) {
++ min = r->range[0]->value_min;
++ max = r->range[0]->value_max;
++ }
++ av_opt_freep_ranges (&r);
+ }
+
+ help = g_strdup_printf ("%s%s", opt->help, extra_help);
+--
+2.17.0
+
diff --git a/media-plugins/gst-plugins-libav/gst-plugins-libav-1.14.4.4.1.1_p20190113.ebuild b/media-plugins/gst-plugins-libav/gst-plugins-libav-1.14.4.4.1.1_p20190113.ebuild
new file mode 100644
index 000000000000..5b725f793bbf
--- /dev/null
+++ b/media-plugins/gst-plugins-libav/gst-plugins-libav-1.14.4.4.1.1_p20190113.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eapi7-ver multilib-minimal
+
+MY_PN="gst-libav"
+MY_PV="$(ver_cut 1-3)"
+MY_P="${MY_PN}-${MY_PV}"
+FFMPEG_PV="$(ver_cut 4- ${PV%_*})"
+
+DESCRIPTION="FFmpeg based gstreamer plugin"
+HOMEPAGE="https://gstreamer.freedesktop.org/modules/gst-libav.html"
+SRC_URI="https://gstreamer.freedesktop.org/src/${MY_PN}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~leio/distfiles/${MY_P}-ffmpeg4-patchset.tar.xz
+ libav? ( https://ffmpeg.org/releases/ffmpeg-${FFMPEG_PV}.tar.bz2 )"
+
+LICENSE="LGPL-2+"
+SLOT="1.0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~x86-fbsd"
+IUSE="libav +orc"
+
+RDEPEND="
+ >=dev-libs/glib-2.40.0:2[${MULTILIB_USEDEP}]
+ >=media-libs/gstreamer-${MY_PV}:1.0[${MULTILIB_USEDEP}]
+ >=media-libs/gst-plugins-base-${MY_PV}:1.0[${MULTILIB_USEDEP}]
+ !libav? ( >=media-video/ffmpeg-4:0=[${MULTILIB_USEDEP}] )
+ libav? (
+ app-arch/bzip2[${MULTILIB_USEDEP}]
+ app-arch/xz-utils[${MULTILIB_USEDEP}]
+ )
+ orc? ( >=dev-lang/orc-0.4.17[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+ >=dev-util/gtk-doc-am-1.12
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${WORKDIR}"/patches # ffmpeg-4 compat and more from git up to 20181115; requires eautoreconf
+ "${FILESDIR}"/AVOptionsRanges-leak-fix.patch # extra patch from Jan 2019 for a leak fix
+ "${FILESDIR}"/external-ffmpeg4-dep.patch # Automatically rescan available elements for registry when system ffmpeg changes
+)
+
+RESTRICT="test" # FIXME: tests seem to get stuck at one point; investigate properly
+
+src_unpack() {
+ default
+
+ if use libav; then
+ # Use newer version of bundled FFmpeg.
+ rm -r "${S}/gst-libs/ext/libav" || die
+ ln -s ../../../ffmpeg-${FFMPEG_PV} "${S}/gst-libs/ext/libav" || die
+ fi
+}
+
+src_prepare() {
+ default
+ eautoreconf # remove with a proper release without build system touching patchset
+}
+
+multilib_src_configure() {
+ GST_PLUGINS_BUILD=""
+ # Upstream dropped support for system libav and won't work
+ # for preserving its compat anymore, forcing us to rely on internal
+ # ffmpeg copy if we don't want to cause unresolvable blockers for
+ # libav setups.
+ # https://bugzilla.gnome.org/show_bug.cgi?id=758183
+ # Prefer system ffmpeg for -libav
+ local myconf=()
+
+ if use libav; then
+ ewarn "Using bundled ffmpeg copy as upstream dropped"
+ ewarn "the support for compiling against system libav"
+ ewarn "https://bugzilla.gnome.org/show_bug.cgi?id=758183"
+
+ myconf+=(--with-libav-extra-configure="--disable-debug --optflags=\\\"${CFLAGS}\\\"")
+ else
+ myconf+=("--with-system-libav")
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-maintainer-mode \
+ --with-package-name="Gentoo GStreamer ebuild" \
+ --with-package-origin="https://www.gentoo.org" \
+ --disable-fatal-warnings \
+ $(use_enable orc) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ # Don't build with -Werror; verbose build
+ emake ERROR_CFLAGS= V=1
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${ED}" -name '*.la' -delete || die
+}