M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,20 @@
Disable yasm for libav when --disable-yasm
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Shane Wang <shane.wang@intel.com>
diff -r f2f8f74c6e30 configure.ac
--- a/configure.ac Thu Dec 22 23:56:09 2011 +0800
+++ b/configure.ac Thu Dec 22 23:57:37 2011 +0800
@@ -325,6 +325,10 @@
--enable-gpl"
fi
+ if test "x$disable_yasm" != "xyes"; then
+ embffmpeg_configure_args="$embffmpeg_configure_args --disable-yasm"
+ fi
+
# if we are cross-compiling, tell ffmpeg so
target_os=`echo $host_os | sed 's/-gnu//'`
if test "x$cross_compiling" = xyes; then
@@ -0,0 +1,16 @@
Lower the rank of ffmpeg plugin so codecs that hook into accelerated pieces (e.g. dsp or hw engines) can get picked over this
Derived from OE by Dongxiao Xu <dongxiao.xu@intel.com>
Upstream-Status: Inappropriate [embedded specific]
--- /tmp/gstffmpegdec.c 2009-03-05 09:31:15.000000000 +0100
+++ gst-ffmpeg-0.10.6/ext/ffmpeg/gstffmpegdec.c 2009-03-05 09:33:09.000000000 +0100
@@ -2588,7 +2588,7 @@
case CODEC_ID_MSMPEG4V3:
case CODEC_ID_H264:
case CODEC_ID_COOK:
- rank = GST_RANK_PRIMARY;
+ rank = GST_RANK_SECONDARY;
break;
case CODEC_ID_DVVIDEO:
/* we have a good dv decoder, fast on both ppc as well as x86. they say
@@ -0,0 +1,40 @@
DESCRIPTION = "FFmpeg-based GStreamer plug-in"
SECTION = "multimedia"
LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://ext/libpostproc/gstpostproc.c;beginline=1;endline=18;md5=5896e445e41681324381f5869ee33d38 \
file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://ext/ffmpeg/gstffmpeg.h;beginline=1;endline=18;md5=ff65467b0c53cdfa98d0684c1bc240a9 \
file://gst-libs/ext/libav/LICENSE;md5=abc3b8cb02856aa7823bbbd162d16232 \
file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=e344c8fa836c3a41c4cbd79d7bd3a379 \
file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
HOMEPAGE = "http://www.gstreamer.net/"
DEPENDS = "gstreamer gst-plugins-base zlib"
inherit autotools pkgconfig
SRC_URI = "http://gstreamer.freedesktop.org/src/${BPN}/${BPN}-${PV}.tar.bz2 \
file://lower-rank.diff \
file://configure-fix.patch \
"
SRC_URI[md5sum] = "7f5beacaf1312db2db30a026b36888c4"
SRC_URI[sha256sum] = "76fca05b08e00134e3cb92fa347507f42cbd48ddb08ed3343a912def187fbb62"
PR = "r1"
EXTRA_OECONF = "--with-ffmpeg-extra-configure=\"--target-os=linux\" "
# yasm not found, use --disable-yasm for a crippled build for libav
EXTRA_OECONF_append_x86-64 = " --disable-yasm "
EXTRA_OECONF_append_x86 = " --disable-yasm "
FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.la"
FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/*.a"
# Hack to get STAGING_LIBDIR into the linker path when building ffmpeg
CC = "${CCACHE} ${HOST_PREFIX}gcc ${TARGET_CC_ARCH} -L${STAGING_LIBDIR}"
@@ -0,0 +1,14 @@
require gst-fluendo.inc
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=98326cbb1723a5a97e9b1db62e9faa05"
LICENSE_FLAGS = "commercial"
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
PR = "r0"
DESCRIPTION = "Fluendo closed-format mp3 GStreamer plug-in"
SRC_URI[md5sum] = "33df57590e3f21f945fe7bace6146fa0"
SRC_URI[sha256sum] = "12dbd307b25fed502a52666a9c956230da09ee140a18d987452492393340f442"
@@ -0,0 +1,13 @@
require gst-fluendo.inc
DESCRIPTION = "Fluendo closed-format mpeg video GStreamer plug-in"
LICENSE = "MPLv1.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=be282f1c3cc9a98cc0dc5c2b25dfc510 \
file://src/gstmpegdemux.h;beginline=1;endline=19;md5=a9e90033f59897b91664d9f2a2ff01dd"
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
PR = "r0"
SRC_URI[md5sum] = "098105ecb68779f34097faf35214fc97"
SRC_URI[sha256sum] = "a62a1249f05c5b6d9d0ab31a0d5cb15f2682587dec0050fc57c1102a6d76b32d"
@@ -0,0 +1,14 @@
DESCRIPTION = "Fluendo closed-format GStreamer plug-in"
SECTION = "multimedia"
HOMEPAGE = "http://www.fluendo.com/resources/source-plugins.php"
DEPENDS = "gstreamer zlib"
inherit autotools pkgconfig
SRC_URI = "http://core.fluendo.com/gstreamer/src/${BPN}/${BPN}-${PV}.tar.bz2"
FILES_${PN} += "${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/*.la ${libdir}/gstreamer-0.10/*.a"
EXTRA_OECONF = "--disable-debug --disable-valgrind"
@@ -0,0 +1,60 @@
DESCRIPTION = "Gstreamer package groups"
LICENSE = "MIT"
DEPENDS = "gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PR = "r10"
PACKAGES = "\
gst-meta-base \
gst-meta-audio \
gst-meta-debug \
gst-meta-video"
ALLOW_EMPTY = "1"
RDEPENDS_gst-meta-base = "\
gstreamer \
gst-plugins-base-playbin \
gst-plugins-base-decodebin \
gst-plugins-base-decodebin2 \
gst-plugins-base-gio \
gst-plugins-base-alsa \
gst-plugins-base-volume \
gst-plugins-base-ximagesink \
gst-plugins-base-audioconvert \
gst-plugins-base-audioresample \
gst-plugins-base-typefindfunctions \
gst-plugins-base-videoscale \
gst-plugins-base-ffmpegcolorspace \
gst-plugins-good-autodetect \
gst-plugins-good-souphttpsrc"
RDEPENDS_gst-meta-audio = "\
gst-meta-base \
gst-plugins-base-vorbis \
gst-plugins-base-ogg \
gst-plugins-good-wavparse \
gst-plugins-good-flac \
${COMMERCIAL_AUDIO_PLUGINS}"
RDEPENDS_gst-meta-debug = "\
gst-meta-base \
gst-plugins-good-debug \
gst-plugins-base-audiotestsrc \
gst-plugins-base-videotestsrc"
RDEPENDS_gst-meta-video = "\
gst-meta-base \
gst-plugins-good-avi \
gst-plugins-good-matroska \
gst-plugins-base-theora \
${COMMERCIAL_VIDEO_PLUGINS}"
RRECOMMENDS_gst-meta-video = "\
gst-meta-audio"
@@ -0,0 +1,18 @@
Upstream-Status: Pending
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Index: gst-openmax-0.10.1/omx/gstomx.c
===================================================================
--- gst-openmax-0.10.1.orig/omx/gstomx.c 2010-09-30 18:00:24.000000000 -0700
+++ gst-openmax-0.10.1/omx/gstomx.c 2011-05-17 23:08:08.794535872 -0700
@@ -238,7 +238,8 @@
const gchar *element_name = gst_structure_nth_field_name (element_table, i);
GstStructure *element = get_element_entry (element_name);
const gchar *type_name, *parent_type_name;
- const gchar *component_name, *component_role, *library_name;
+ const gchar *component_name, *library_name;
+ const gchar __attribute__((__unused__)) *component_role;
GType type;
gint rank;
@@ -0,0 +1,24 @@
DEPENDS = "gstreamer"
RDEPENDS_${PN} = "libomxil"
LICENSE = "LGPLv2.1"
LICENSE_FLAGS = "commercial"
LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24 \
file://util/sem.h;beginline=1;endline=20;md5=accce5550d5583b839b441a0623f09fc"
SRC_URI = "http://gstreamer.freedesktop.org/src/gst-openmax/gst-openmax-${PV}.tar.bz2 \
file://gcc_4.6.patch \
"
inherit autotools
EXTRA_OECONF += "--disable-valgrind"
PR = "r3"
FILES_${PN} += "${libdir}/gstreamer-0.10/libgstomx.so"
FILES_${PN}-dev += "${libdir}/gstreamer-0.10/libgstomx.la"
FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/libgstomx.a"
FILES_${PN}-dbg += "${libdir}/gstreamer-0.10/.debug/"
SRC_URI[md5sum] = "4d0370bfe99dea20918c84347abadb4e"
SRC_URI[sha256sum] = "9074d5a0591995133d19cfb15144f19664f902c1623f996595695cf2c2070e1f"
@@ -0,0 +1,26 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+ "
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
file://gst/tta/filters.h;beginline=12;endline=29;md5=629b0c7a665d155a6677778f4460ec06 \
file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://gst/tta/crc32.h;beginline=12;endline=29;md5=71a904d99ce7ae0c1cf129891b98145c"
DEPENDS += "gst-plugins-base libmusicbrainz tremor librsvg"
PR = "r1"
inherit gettext
EXTRA_OECONF += "--disable-examples --disable-experimental --disable-sdl --disable-cdaudio \
--with-plugins=musicbrainz,wavpack,ivorbis,mpegvideoparse --disable-vdpau --disable-apexsink"
ARM_INSTRUCTION_SET = "arm"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm ${S}/m4/lib-link.m4 || true
}
SRC_URI[md5sum] = "9a2acee1f386f71247003d0d7090fb1c"
SRC_URI[sha256sum] = "d8f7102f43ffea076646427115ffdccb3975954f1e9367bd304f7ee01e12070c"
@@ -0,0 +1,19 @@
Remove -DTREMOR option since Tremor has dropped its internal
libogg2, and gst-plugins-base has dependency on that.
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
diff -ruN gst-plugins-base-0.10.30-orig/ext/vorbis/Makefile.am gst-plugins-base-0.10.30/ext/vorbis/Makefile.am
--- gst-plugins-base-0.10.30-orig/ext/vorbis/Makefile.am 2010-11-17 16:11:03.000000000 +0800
+++ gst-plugins-base-0.10.30/ext/vorbis/Makefile.am 2010-11-17 16:12:41.000000000 +0800
@@ -28,7 +28,7 @@
libgstivorbisdec_la_SOURCES = gstivorbisdec.c \
gstvorbisdec.c gstvorbisdeclib.c gstvorbiscommon.c
libgstivorbisdec_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
- -DTREMOR $(IVORBIS_CFLAGS)
+ $(IVORBIS_CFLAGS)
libgstivorbisdec_la_LIBADD = \
$(top_builddir)/gst-libs/gst/tag/libgsttag-@GST_MAJORMINOR@.la \
$(top_builddir)/gst-libs/gst/audio/libgstaudio-@GST_MAJORMINOR@.la \
@@ -0,0 +1,25 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=622921ffad8cb18ab906c56052788a3f \
file://COPYING.LIB;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://gst/ffmpegcolorspace/utils.c;beginline=1;endline=20;md5=9c83a200b8e597b26ca29df20fc6ecd0"
DEPENDS += "virtual/libx11 alsa-lib freetype liboil libogg libvorbis libxv libtheora avahi util-linux tremor"
SRC_URI += " file://gst-plugins-base-tremor.patch"
SRC_URI[md5sum] = "1d300983525f4f09030eb3ba47cb04b0"
SRC_URI[sha256sum] = "cd24f01bb5258a1f400bc4f2c212bb7cee9ee23c9ffb80d537a24ef366d17103"
PR = "r0"
inherit gettext
EXTRA_OECONF += "--disable-freetypetest --disable-pango --disable-gnome_vfs"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm -f ${S}/m4/lib-link.m4
}
@@ -0,0 +1,24 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2.1+"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=622921ffad8cb18ab906c56052788a3f \
file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
DEPENDS += "gst-plugins-base gconf cairo jpeg libpng gtk+ zlib libid3tag flac \
speex libsoup-2.4 pulseaudio"
PR = "r4"
inherit gettext gconf
EXTRA_OECONF += "--disable-aalib --disable-esd --disable-shout2 --disable-libcaca --disable-hal --without-check"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm ${S}/m4/lib-link.m4 || true
}
SRC_URI[md5sum] = "62fd7a3ef187c4f99b3d7c352d58dae9"
SRC_URI[sha256sum] = "b12cba90b27d8423cd0a808939098d19db3996cfb9bf528507c6321782e095f6"
FILES_${PN}-gconfelements += "${sysconfdir}/gconf/schemas/gstreamer-0.10.schemas"
@@ -0,0 +1,35 @@
LIBV = "0.10"
python populate_packages_prepend () {
gst_libdir = bb.data.expand('${libdir}/gstreamer-${LIBV}', d)
postinst = d.getVar('plugin_postinst', True)
glibdir = d.getVar('libdir', True)
do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', bb.data.expand('${PN}-%s', d), 'GStreamer plugin for %s', postinst=postinst, extra_depends=bb.data.expand('${PN}',d))
do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', bb.data.expand('${PN}-%s-dev', d), 'GStreamer plugin for %s (development files)', extra_depends=bb.data.expand('${PN}-dev',d))
do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', bb.data.expand('${PN}-%s-staticdev', d), 'GStreamer plugin for %s (static development files)', extra_depends=bb.data.expand('${PN}-staticdev',d))
pn = d.getVar('PN', 1)
metapkg = pn + '-meta'
d.setVar('ALLOW_EMPTY_' + metapkg, "1")
d.setVar('FILES_' + metapkg, "")
blacklist = [ pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc' ]
metapkg_rdepends = []
packages = d.getVar('PACKAGES', 1).split()
for pkg in packages[1:]:
if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'):
metapkg_rdepends.append(pkg)
d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
}
ALLOW_EMPTY = "1"
PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
FILES_${PN}-apps = "${bindir}"
FILES_${PN} = "${datadir}/gstreamer-${LIBV}"
FILES_${PN}-dbg += "${libdir}/gstreamer-${LIBV}/.debug"
FILES_${PN}-glib = "${datadir}/glib-2.0"
@@ -0,0 +1,23 @@
require gst-plugins.inc
LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+"
LICENSE_FLAGS = "commercial"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
file://gst/synaesthesia/synaescope.h;beginline=1;endline=20;md5=99f301df7b80490c6ff8305fcc712838 \
file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068 \
file://gst/mpegstream/gstmpegparse.h;beginline=1;endline=18;md5=ff65467b0c53cdfa98d0684c1bc240a9"
DEPENDS += "gst-plugins-base libid3tag libmad mpeg2dec liba52 lame"
PR = "r0"
inherit gettext
EXTRA_OECONF += "--with-plugins=a52dec,lame,id3tag,mad,mpeg2dec,mpegstream,mpegaudioparse,asfdemux,realmedia"
do_configure_prepend() {
# This m4 file contains nastiness which conflicts with libtool 2.2.2
rm ${S}/m4/lib-link.m4 || true
}
SRC_URI[md5sum] = "04a7009a4efea2844075949c111f5e4d"
SRC_URI[sha256sum] = "f9c16748cd9269fae86422d8254a579fa6db073797a5a19a9dc5c72cd66c8e14"
@@ -0,0 +1,28 @@
DESCRIPTION = "Plugins for GStreamer"
HOMEPAGE = "http://gstreamer.freedesktop.org/"
BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
SECTION = "multimedia"
DEPENDS = "gstreamer"
inherit autotools pkgconfig
FILESPATH =. "${FILE_DIRNAME}/gst-plugins:"
SRC_URI = "http://gstreamer.freedesktop.org/src/${BPN}/${BPN}-${PV}.tar.bz2"
EXTRA_OECONF = "--disable-valgrind --disable-debug --disable-examples "
acpaths = "-I ${S}/common/m4 -I ${S}/m4"
# orc.m4 calls pkg-config ----variable=orcc orc-0.4 to get the path to orcc,
# resulting in /usr/bin/orcc. Force it to use the staged orcc.
do_configure_append() {
for i in $(find ${S} -name "Makefile") ; do
sed -i -e s:${bindir}/orcc:${STAGING_BINDIR_NATIVE}/orcc:g $i
done
}
require gst-plugins-package.inc
PACKAGES_DYNAMIC = "${PN}-*"
@@ -0,0 +1,19 @@
# gstreamer: Fix a problem with configure if check has already been built
# Richard Purdie <rpurdie@linux.intel.com>
Upstream-Status: Inappropriate [configuration]
diff -urN gstreamer-0.10.29-orig/configure.ac gstreamer-0.10.29/configure.ac
--- gstreamer-0.10.29-orig/configure.ac 2010-06-26 12:49:27.774930773 +0800
+++ gstreamer-0.10.29/configure.ac 2010-06-26 12:51:12.899200233 +0800
@@ -543,8 +543,10 @@
*) BUILD_CHECK=yes ;;
esac
])
+
dnl bit of a misnomer, but keep the conditional named like this so we don't
dnl have to change too much elsewhere
+HAVE_CHECK=no
AM_CONDITIONAL(HAVE_CHECK, test "x$BUILD_CHECK" = "xyes")
dnl configure the desired buffer alignment
@@ -0,0 +1,16 @@
# Fix crash with gst-inspect
# Chris Lord <chris@openedhand.com>
Upstream-Status: Pending
--- gstreamer-0.10.9/tools/gst-inspect.c.old 2006-09-12 11:56:53.000000000 +0100
+++ gstreamer-0.10.9/tools/gst-inspect.c 2006-09-12 11:57:27.000000000 +0100
@@ -1123,7 +1123,7 @@
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
g_option_context_add_group (ctx, gst_init_get_option_group ());
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
- g_print ("Error initializing: %s\n", err->message);
+ g_print ("Error initializing: %s\n", err ? err->message : "(null)");
exit (1);
}
g_option_context_free (ctx);
@@ -0,0 +1,487 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
* 2005 David A. Schleef <ds@schleef.org>
*
* gstregistryxml.c: GstRegistry object, support routines
*
* This library is free software; you can redistribute it and/or
* modify it ulnder the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gst/gstregistrybinary.h>
/*
** Simple handy function to write a memory location to the registry cache file
*/
inline static gboolean
gst_registry_binary_write(GstRegistry *registry, const void *mem, const ssize_t size)
{
if (write(registry->cache_file, mem, size) != size)
{
GST_ERROR("Failed to write binary registry element: ptr=%p size=%u error=%s\n",
mem, size, strerror(errno));
return FALSE;
}
return TRUE;
}
/*
** Save features GstBinary style
*/
static gboolean
gst_registry_binary_fill_feature(GList **list, GstPluginFeature *orig, GstBinaryPluginFeature *dest, const char *name)
{
GstBinaryChunck *chk;
if ((chk = calloc(1, sizeof (GstBinaryChunck))) == NULL)
return FALSE;
chk->data = dest;
chk->size = sizeof (GstBinaryPluginFeature);
*list = g_list_append(*list, chk);
dest->rank = orig->rank;
if (!strncpy(dest->typename, name, GST_BINARY_REGISTRY_TYPENAME_TYPENAME_LEN) ||
!strncpy(dest->name, orig->name, GST_BINARY_REGISTRY_TYPENAME_NAME_LEN))
{
GST_ERROR("Failed to write binary registry feature");
goto fail;
}
if (GST_IS_ELEMENT_FACTORY(orig))
{
GstElementFactory *factory = GST_ELEMENT_FACTORY(orig);
if (!strncpy(dest->longname, factory->details.longname, GST_BINARY_REGISTRY_TYPENAME_LONGNAME_LEN) ||
!strncpy(dest->class, factory->details.klass, GST_BINARY_REGISTRY_TYPENAME_CLASS_LEN) ||
!strncpy(dest->description, factory->details.description, GST_BINARY_REGISTRY_TYPENAME_DESCRIPTION_LEN) ||
!strncpy(dest->author, factory->details.author, GST_BINARY_REGISTRY_TYPENAME_AUTHOR_LEN))
{
GST_ERROR("Failed to write binary registry feature");
goto fail;
}
}
dest->npadtemplates = dest->ninterfaces = dest->nuritypes = 0;
return TRUE;
fail:
free(chk);
return FALSE;
}
/*
** Initialize the GstBinaryRegistryMagic, setting both our magic number and gstreamer major/minor version
*/
inline static gboolean
gst_registry_binary_initialize_magic(GstBinaryRegistryMagic *m)
{
if (!strncpy(m->magic, GST_MAGIC_BINARY_REGISTRY_STR, GST_MAGIC_BINARY_REGISTRY_LEN) ||
!strncpy(m->version, GST_MAJORMINOR, GST_BINARY_REGISTRY_VERSION_LEN))
{
GST_ERROR("Failed to write magic to the registry magic structure");
return FALSE;
}
return TRUE;
}
/*
** Check GstBinaryRegistryMagic validity.
** Return a pointer pointing right after the magic structure
*/
static gchar *
gst_registry_binary_check_magic(gchar *in)
{
GstBinaryRegistryMagic *m = (GstBinaryRegistryMagic *) in;
if (m == NULL || m->magic == NULL || m->version == NULL)
{
GST_ERROR("Binary registry magic structure is broken");
return NULL;
}
if (strncmp(m->magic, GST_MAGIC_BINARY_REGISTRY_STR, GST_MAGIC_BINARY_REGISTRY_LEN) != 0)
{
GST_ERROR("Binary registry magic is different : %02x%02x%02x%02x != %02x%02x%02x%02x",
GST_MAGIC_BINARY_REGISTRY_STR[0] & 0xff, GST_MAGIC_BINARY_REGISTRY_STR[1] & 0xff,
GST_MAGIC_BINARY_REGISTRY_STR[2] & 0xff, GST_MAGIC_BINARY_REGISTRY_STR[3] & 0xff,
m->magic[0] & 0xff, m->magic[1] & 0xff, m->magic[2] & 0xff, m->magic[3] & 0xff);
return NULL;
}
if (strncmp(m->version, GST_MAJORMINOR, GST_BINARY_REGISTRY_VERSION_LEN))
{
GST_ERROR("Binary registry magic version is different : %s != %s",
GST_MAJORMINOR, m->version);
return NULL;
}
return (in + sizeof (GstBinaryRegistryMagic));
}
/*
** Adapt a GstPlugin to our GstBinaryPluginElement structure, and write it to the
** registry file.
*/
static gboolean
gst_registry_binary_save_plugin(GList **list, GstRegistry *registry, GstPlugin *plugin)
{
GstBinaryPluginElement *e;
GstBinaryChunck *chk;
GList *walk;
if ((e = calloc(1, sizeof (GstBinaryPluginElement))) == NULL ||
(chk = calloc(1, sizeof (GstBinaryChunck))) == NULL)
return FALSE;
chk->data = e;
chk->size = sizeof (GstBinaryPluginElement);
*list = g_list_append(*list, chk);
if (!strncpy(e->name, plugin->desc.name, GST_BINARY_REGISTRY_NAME_LEN) ||
!strncpy(e->description, plugin->desc.description, GST_BINARY_REGISTRY_DESCRIPTION_LEN) ||
!strncpy(e->filename, plugin->filename, _POSIX_PATH_MAX) ||
!strncpy(e->version, plugin->desc.version, GST_BINARY_REGISTRY_VERSION_LEN) ||
!strncpy(e->license, plugin->desc.license, GST_BINARY_REGISTRY_LICENSE_LEN) ||
!strncpy(e->source, plugin->desc.source, GST_BINARY_REGISTRY_SOURCE_LEN) ||
!strncpy(e->package, plugin->desc.package, GST_BINARY_REGISTRY_PACKAGE_LEN) ||
!strncpy(e->origin, plugin->desc.origin, GST_BINARY_REGISTRY_ORIGIN_LEN))
{
GST_DEBUG("Can't adapt GstPlugin to GstBinaryPluginElement");
goto fail;
}
e->size = plugin->file_size;
e->m32p = plugin->file_mtime;
GList *ft_list = gst_registry_get_feature_list_by_plugin(registry, plugin->desc.name);
for (walk = ft_list; walk; walk = g_list_next(walk), e->nfeatures++)
{
GstPluginFeature *curfeat = GST_PLUGIN_FEATURE (walk->data);
GstBinaryPluginFeature *newfeat;
const char *feat_name = g_type_name(G_OBJECT_TYPE(curfeat));
if ((newfeat = calloc(1, sizeof (GstBinaryPluginFeature))) == NULL)
goto fail;
if (!feat_name || !gst_registry_binary_fill_feature(list, curfeat, newfeat, feat_name))
{
GST_ERROR("Can't fill plugin feature, aborting.");
goto fail;
}
}
GST_DEBUG("Found %d features in plugin \"%s\"\n", e->nfeatures, e->name);
return TRUE;
fail:
free(chk);
free(e);
return FALSE;
}
/*
** Write the cache to file. Part of the code was taken from gstregistryxml.c
*/
gboolean
gst_registry_binary_write_cache(GstRegistry *registry, const char *location)
{
GList *walk;
char *tmp_location;
GstBinaryRegistryMagic *magic;
GstBinaryChunck *magic_chunck;
GList *to_write = NULL;
GST_INFO("Writing binary registry cache");
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
tmp_location = g_strconcat (location, ".tmpXXXXXX", NULL);
registry->cache_file = g_mkstemp (tmp_location);
if (registry->cache_file == -1)
{
char *dir;
/* oops, I bet the directory doesn't exist */
dir = g_path_get_dirname (location);
g_mkdir_with_parents (dir, 0777);
g_free (dir);
registry->cache_file = g_mkstemp (tmp_location);
}
if (registry->cache_file == -1)
goto fail;
if ((magic = calloc(1, sizeof (GstBinaryRegistryMagic))) == NULL ||
!gst_registry_binary_initialize_magic(magic))
goto fail;
if ((magic_chunck = calloc(1, sizeof (GstBinaryChunck))) == NULL)
goto fail;
magic_chunck->data = magic;
magic_chunck->size = sizeof (GstBinaryRegistryMagic);
to_write = g_list_append(to_write, magic_chunck);
/* Iterate trough the list of plugins in the GstRegistry and adapt them to our structures */
for (walk = g_list_last(registry->plugins); walk; walk = g_list_previous(walk))
{
GstPlugin *plugin = GST_PLUGIN(walk->data);
if (!plugin->filename)
continue;
if (plugin->flags & GST_PLUGIN_FLAG_CACHED)
{
int ret;
struct stat statbuf;
ret = g_stat (plugin->filename, &statbuf);
if ((ret = g_stat (plugin->filename, &statbuf)) < 0 ||
plugin->file_mtime != statbuf.st_mtime ||
plugin->file_size != statbuf.st_size)
continue;
}
if (!gst_registry_binary_save_plugin(&to_write, registry, plugin))
{
GST_ERROR("Can't write binary plugin information for \"%s\"", plugin->filename);
continue; /* Try anyway */
}
}
for (walk = g_list_first(to_write); walk; walk = g_list_next(walk))
{
GstBinaryChunck *cur = walk->data;
if (!gst_registry_binary_write(registry, cur->data, cur->size))
{
free(cur->data);
free(cur);
g_list_free(to_write);
goto fail;
}
free(cur->data);
free(cur);
}
g_list_free(to_write);
if (close(registry->cache_file) < 0)
{
GST_DEBUG("Can't close registry file : %s", strerror(errno));
goto fail;
}
if (g_file_test (tmp_location, G_FILE_TEST_EXISTS)) {
#ifdef WIN32
remove (location);
#endif
rename (tmp_location, location);
}
g_free (tmp_location);
return TRUE;
fail:
g_free(tmp_location);
return FALSE;
}
static GstPluginFeature*
gst_registry_binary_load_feature(GstBinaryPluginFeature *in)
{
GstPluginFeature *feature;
GType type;
if (!in->typename || !*(in->typename))
return NULL;
/* GST_INFO("Plugin feature typename : %s", in->typename);*/
if (!(type = g_type_from_name(in->typename)))
{
GST_ERROR("Unknown type from typename");
return NULL;
}
feature = g_object_new (type, NULL);
if (!feature) {
GST_ERROR("Can't create feature from type");
return NULL;
}
if (!GST_IS_PLUGIN_FEATURE (feature)) {
/* don't really know what it is */
if (GST_IS_OBJECT (feature))
gst_object_unref (feature);
else
g_object_unref (feature);
return NULL;
}
feature->name = g_strdup(in->name);
feature->rank = in->rank;
if (GST_IS_ELEMENT_FACTORY(feature))
{
GstElementFactory *factory = GST_ELEMENT_FACTORY(feature);
factory->details.longname = g_strdup(in->longname);
factory->details.klass = g_strdup(in->class);
factory->details.description = g_strdup(in->description);
factory->details.author = g_strdup(in->author);
/* GST_INFO("Element factory : %s", factory->details.longname); */
}
GST_DEBUG("Added feature %p with name %s", feature, feature->name);
return feature;
}
/*
** Make a new plugin from current GstBinaryPluginElement structure
** and save it to the GstRegistry. Return an offset to the next
** GstBinaryPluginElement structure.
*/
static unsigned long
gst_registry_binary_get_binary_plugin(GstRegistry *registry, gchar *in)
{
GstBinaryPluginElement *p = (GstBinaryPluginElement *) in;
GstPlugin *plugin = NULL;
GList *plugin_features = NULL;
GstBinaryPluginFeature *feat;
unsigned int i;
unsigned long offset;
plugin = g_object_new (GST_TYPE_PLUGIN, NULL);
plugin->flags |= GST_PLUGIN_FLAG_CACHED;
plugin->desc.name = g_strdup(p->name);
plugin->desc.description= g_strdup(p->description);
plugin->filename = g_strdup(p->filename);
plugin->desc.version = g_strdup(p->version);
plugin->desc.license = g_strdup(p->license);
plugin->desc.source = g_strdup(p->source);
plugin->desc.package = g_strdup(p->package);
plugin->desc.origin = g_strdup(p->origin);
plugin->file_mtime = p->m32p;
plugin->file_size = p->size;
plugin->basename = g_path_get_basename (plugin->filename);
if (plugin->file_mtime < 0 || plugin->file_size < 0)
{
GST_ERROR("Plugin time or file size is not valid !");
g_free(plugin);
return -1;
}
if (p->nfeatures < 0)
{
GST_ERROR("The number of feature structure is not valid !");
gst_object_unref(plugin);
return -1;
}
for (feat = (GstBinaryPluginFeature *) (in + sizeof (GstBinaryPluginElement)), i = 0;
i < p->nfeatures; i++, feat++)
{
GstPluginFeature *gstfeat;
if ((gstfeat = gst_registry_binary_load_feature(feat)) == NULL)
{
g_list_free(plugin_features);
g_free(plugin);
GST_ERROR("Error while loading binary feature");
return -1;
}
gstfeat->plugin_name = g_strdup(plugin->desc.name);
plugin_features = g_list_prepend(plugin_features, gstfeat);
}
GST_DEBUG("Added plugin \"%s\" to global registry from binary registry", plugin->desc.name);
GList *g;
gst_registry_add_plugin (registry, plugin);
for (g = plugin_features; g; g = g_list_next (g))
gst_registry_add_feature (registry, GST_PLUGIN_FEATURE (g->data));
/* g_list_free(plugin_features); */
offset = sizeof (GstBinaryPluginElement) + p->nfeatures * sizeof (GstBinaryPluginFeature);
return offset;
}
/*
** Read the cache and adapt it to fill GstRegistry
*/
gboolean
gst_registry_binary_read_cache(GstRegistry *registry, const char *location)
{
GMappedFile *mapped = NULL;
GTimer *timer = NULL;
gchar *contents = NULL;
gdouble seconds;
unsigned long offset, inc;
gsize size;
/* make sure these types exist */
GST_TYPE_ELEMENT_FACTORY;
GST_TYPE_TYPE_FIND_FACTORY;
GST_TYPE_INDEX_FACTORY;
timer = g_timer_new ();
if ((mapped = g_mapped_file_new(location, FALSE, NULL)) == NULL ||
(contents = g_mapped_file_get_contents(mapped)) == NULL)
{
GST_ERROR("Can't load file : %s", strerror(errno));
return FALSE;
}
if ((contents = gst_registry_binary_check_magic(contents)) == NULL)
{
GST_ERROR("Binary registry type not recognized (invalid magic)");
g_mapped_file_free(mapped);
return FALSE;
}
if ((size = g_mapped_file_get_length(mapped)) < sizeof (GstBinaryPluginElement))
{
GST_INFO("No binary plugins structure to read");
return TRUE; /* This is not really an error */
}
for (offset = inc = 0; (offset + sizeof (GstBinaryPluginElement)) < size &&
(inc = gst_registry_binary_get_binary_plugin(registry, contents + offset)) > 0;
offset += inc)
; /* May want in the future to do something here */
if (inc < 0)
{
GST_DEBUG("Problem while reading binary registry");
return FALSE;
}
g_timer_stop (timer);
seconds = g_timer_elapsed (timer, NULL);
g_timer_destroy (timer);
GST_INFO ("loaded %s in %f seconds", location, seconds);
if (mapped)
g_mapped_file_free (mapped);
return TRUE;
}
@@ -0,0 +1,194 @@
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wim.taymans@chello.be>
*
* gstregistry.h: Header for registry handling
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* SUGGESTIONS AND TODO :
** ====================
** - Use a compressed registry, but would induce performance loss
** - Encrypt the registry, for security purpose, but would also reduce performances
** - Also have a non-mmap based cache reading (work with file descriptors)
*/
#ifndef __GST_REGISTRYBINARY_H__
#define __GST_REGISTRYBINARY_H__
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/mman.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gst/gst_private.h>
#include <gst/gstelement.h>
#include <gst/gsttypefind.h>
#include <gst/gsttypefindfactory.h>
#include <gst/gsturi.h>
#include <gst/gstinfo.h>
#include <gst/gstenumtypes.h>
#include <gst/gstregistry.h>
#include <gst/gstpadtemplate.h>
#include "glib-compat-private.h"
#include <glib/gstdio.h>
/* A magic, written at the beginning of the file */
#define GST_MAGIC_BINARY_REGISTRY_STR "\xc0\xde\xf0\x0d"
#define GST_MAGIC_BINARY_REGISTRY_LEN (4)
#define GST_MAGIC_BINARY_VERSION_LEN (64)
typedef struct _GstBinaryRegistryMagic
{
char magic[GST_MAGIC_BINARY_REGISTRY_LEN];
char version[GST_MAGIC_BINARY_VERSION_LEN];
} GstBinaryRegistryMagic;
/* Used to store pointers to write */
typedef struct _GstBinaryChunck
{
void *data;
unsigned int size;
} GstBinaryChunck;
/* A structure containing (staticely) every information needed for a plugin
**
** Notes :
** "nfeatures" is used to say how many GstBinaryPluginFeature structures we will have
** right after the structure itself.
*/
/* Various lenght defines for our GstBinaryPluginElement structure
** Note : We could eventually use smaller size
*/
#define GST_BINARY_REGISTRY_NAME_LEN (256)
#define GST_BINARY_REGISTRY_DESCRIPTION_LEN (1024)
#define GST_BINARY_REGISTRY_VERSION_LEN (64)
#define GST_BINARY_REGISTRY_LICENSE_LEN (256)
#define GST_BINARY_REGISTRY_SOURCE_LEN (256)
#define GST_BINARY_REGISTRY_PACKAGE_LEN (1024)
#define GST_BINARY_REGISTRY_ORIGIN_LEN (1024)
typedef struct _GstBinaryPluginElement
{
char name[GST_BINARY_REGISTRY_NAME_LEN];
char description[GST_BINARY_REGISTRY_DESCRIPTION_LEN];
char filename[_POSIX_PATH_MAX];
char version[GST_BINARY_REGISTRY_VERSION_LEN];
char license[GST_BINARY_REGISTRY_LICENSE_LEN];
char source[GST_BINARY_REGISTRY_SOURCE_LEN];
char package[GST_BINARY_REGISTRY_PACKAGE_LEN];
char origin[GST_BINARY_REGISTRY_ORIGIN_LEN];
unsigned long size;
unsigned long m32p;
unsigned int nfeatures;
} GstBinaryPluginElement;
/* A structure containing the plugin features
**
** Note :
** "npadtemplates" is used to store the number of GstBinaryPadTemplate structures following the structure itself.
** "ninterfaces" is used to store the number of GstBinaryInterface structures following the structure itself.
** "nuritypes" is used to store the number of GstBinaryUriType structures following the structure itself.
*/
#define GST_BINARY_REGISTRY_TYPENAME_TYPENAME_LEN (256)
#define GST_BINARY_REGISTRY_TYPENAME_NAME_LEN (256)
#define GST_BINARY_REGISTRY_TYPENAME_LONGNAME_LEN (1024)
#define GST_BINARY_REGISTRY_TYPENAME_CLASS_LEN (512)
#define GST_BINARY_REGISTRY_TYPENAME_DESCRIPTION_LEN (1024)
#define GST_BINARY_REGISTRY_TYPENAME_AUTHOR_LEN (256)
typedef struct _GstBinaryPluginFeature
{
char typename[GST_BINARY_REGISTRY_TYPENAME_TYPENAME_LEN];
char name[GST_BINARY_REGISTRY_TYPENAME_NAME_LEN];
unsigned long rank;
char longname[GST_BINARY_REGISTRY_TYPENAME_LONGNAME_LEN];
char class[GST_BINARY_REGISTRY_TYPENAME_CLASS_LEN];
char description[GST_BINARY_REGISTRY_TYPENAME_DESCRIPTION_LEN];
char author[GST_BINARY_REGISTRY_TYPENAME_AUTHOR_LEN];
unsigned int npadtemplates;
unsigned int ninterfaces;
unsigned int nuritypes;
} GstBinaryPluginFeature;
/*
** A structure containing the static pad templates of a plugin feature
*/
#define GST_BINARY_REGISTRY_PADTEMPLATE_NAME_LEN (256)
#define GST_BINARY_REGISTRY_PADTEMPLATE_CAP_LEN (1024)
typedef struct _GstBinaryPadTemplate
{
char name[GST_BINARY_REGISTRY_PADTEMPLATE_NAME_LEN];
char cap[GST_BINARY_REGISTRY_PADTEMPLATE_CAP_LEN];
int direction; /* Either 0:"sink" or 1:"src" */
GstPadPresence presence;
} GstBinaryPadTemplate;
/*
** A very simple structure defining the plugin feature interface string
*/
#define GST_BINARY_REGISTRY_INTERFACE_INTERFACE_LEN (512)
typedef struct _GstBinaryInterface
{
char interface[GST_BINARY_REGISTRY_INTERFACE_INTERFACE_LEN];
unsigned long size;
} GstBinaryInterface;
/* Uri Type */
typedef struct _GstBinaryUriType
{
GstURIType type;
unsigned long nuriprotocols;
} GstBinaryUriType;
/*
** Function prototypes
*/
/* Local prototypes */
inline static gboolean gst_registry_binary_write(GstRegistry *registry, const void *mem, const ssize_t size);
inline static gboolean gst_registry_binary_initialize_magic(GstBinaryRegistryMagic *m);
static gboolean gst_registry_binary_fill_feature(GList **list, GstPluginFeature *, GstBinaryPluginFeature *, const char *);
static gboolean gst_registry_binary_save_plugin(GList **list, GstRegistry *registry, GstPlugin *plugin);
static gchar *gst_registry_binary_check_magic(gchar *in);
static GstPluginFeature *gst_registry_binary_load_feature(GstBinaryPluginFeature *);
static unsigned long gst_registry_binary_get_binary_plugin(GstRegistry *registry, gchar *in);
/* Exportable */
gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
#endif /* !__GST_REGISTRYBINARY_H__ */
@@ -0,0 +1,34 @@
SUMMARY = "GStreamer multimedia framework"
DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
HOMEPAGE = "http://gstreamer.freedesktop.org/"
BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
SECTION = "multimedia"
LICENSE = "LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
file://gst/gst.h;beginline=1;endline=21;md5=8e5fe5e87d33a04479fde862e238eaa4"
DEPENDS = "glib-2.0 libxml2 bison-native flex-native"
PR = "r1"
SRC_URI = "http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.bz2 \
file://check_fix.patch \
file://gst-inspect-check-error.patch"
SRC_URI[md5sum] = "4a0a00edad7a2c83de5211ca679dfaf9"
SRC_URI[sha256sum] = "817bfea2cd46e2487b97e2ed9218f0299b32a3de1e5e80b4c7868d17e9089786"
inherit autotools pkgconfig gettext
EXTRA_OECONF = "--disable-docs-build --disable-dependency-tracking --with-check=no --disable-examples --disable-tests --disable-valgrind --disable-debug"
#do_compile_prepend () {
# mv ${WORKDIR}/gstregistrybinary.[ch] ${S}/gst/
#}
RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
FILES_${PN} += " ${libdir}/gstreamer-0.10/*.so"
FILES_${PN}-dev += " ${libdir}/gstreamer-0.10/*.la ${libdir}/gstreamer-0.10/*.a"
FILES_${PN}-dbg += " ${libdir}/gstreamer-0.10/.debug/ ${libexecdir}/gstreamer-0.10/.debug/"