mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
xdgmime: move xdg typefinder to the other typefinders in -base
Remove the xdgmime plugin which now barely contains any code at all and move the functionality into gst-plugins-base next to the other typefinders.
This commit is contained in:
parent
95d894fd96
commit
3bb2efeea0
5 changed files with 0 additions and 128 deletions
|
@ -124,7 +124,6 @@ dnl check for libm, for sin() etc.
|
|||
AC_CHECK_LIBM
|
||||
AC_SUBST(LIBM)
|
||||
|
||||
dnl needed for gst/xdgmime
|
||||
AC_FUNC_MMAP
|
||||
|
||||
dnl *** checks for header files ***
|
||||
|
@ -298,7 +297,6 @@ AG_GST_CHECK_PLUGIN(tta)
|
|||
AG_GST_CHECK_PLUGIN(valve)
|
||||
AG_GST_CHECK_PLUGIN(videosignal)
|
||||
AG_GST_CHECK_PLUGIN(vmnc)
|
||||
AG_GST_CHECK_PLUGIN(xdgmime)
|
||||
|
||||
dnl *** plug-ins to exclude ***
|
||||
|
||||
|
@ -312,7 +310,6 @@ dnl disable experimental plug-ins
|
|||
#if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
|
||||
#fi
|
||||
|
||||
# For xdgmime, to use g_content_type_guess()
|
||||
# This will always succeed because we depend on GLib >= 2.16
|
||||
PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.16, HAVE_GIO=yes, HAVE_GIO=no)
|
||||
AC_SUBST(GIO_CFLAGS)
|
||||
|
@ -1749,7 +1746,6 @@ gst/tta/Makefile
|
|||
gst/valve/Makefile
|
||||
gst/videosignal/Makefile
|
||||
gst/vmnc/Makefile
|
||||
gst/xdgmime/Makefile
|
||||
gst-libs/Makefile
|
||||
gst-libs/gst/Makefile
|
||||
gst-libs/gst/interfaces/Makefile
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<plugin>
|
||||
<name>xdgmime</name>
|
||||
<description>XDG-MIME</description>
|
||||
<filename>../../gst/xdgmime/.libs/libgstxdgmime.so</filename>
|
||||
<basename>libgstxdgmime.so</basename>
|
||||
<version>0.10.14.1</version>
|
||||
<license>LGPL</license>
|
||||
<source>gst-plugins-bad</source>
|
||||
<package>GStreamer Bad Plug-ins git/prerelease</package>
|
||||
<origin>Unknown package origin</origin>
|
||||
<elements>
|
||||
|
||||
</elements>
|
||||
</plugin>
|
|
@ -121,7 +121,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_libdir}/gstreamer-%{majorminor}/libgstliveadder.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstrtpmux.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstsiren.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstxdgmime.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstadpcmdec.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgstid3tag.so
|
||||
%{_libdir}/gstreamer-%{majorminor}/libgsthdvparse.so
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
plugin_LTLIBRARIES = libgstxdgmime.la
|
||||
|
||||
libgstxdgmime_la_SOURCES = gstxdgmime.c
|
||||
|
||||
libgstxdgmime_la_CFLAGS = $(GIO_CFLAGS) $(GST_CFLAGS)
|
||||
libgstxdgmime_la_LIBADD = $(GIO_LIBS) $(GST_LIBS)
|
||||
libgstxdgmime_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstxdgmime_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) <2009> Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
GST_DEBUG_CATEGORY (xdgmime_debug);
|
||||
#define GST_CAT_DEFAULT xdgmime_debug
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
static void
|
||||
xdgmime_typefind (GstTypeFind * find, gpointer user_data)
|
||||
{
|
||||
gchar *mimetype;
|
||||
gsize length = 16384;
|
||||
guint64 tf_length;
|
||||
guint8 *data;
|
||||
gchar *tmp;
|
||||
|
||||
if ((tf_length = gst_type_find_get_length (find)) > 0)
|
||||
length = MIN (length, tf_length);
|
||||
|
||||
if ((data = gst_type_find_peek (find, 0, length)) == NULL)
|
||||
return;
|
||||
|
||||
|
||||
tmp = g_content_type_guess (NULL, data, length, NULL);
|
||||
if (tmp == NULL || g_content_type_is_unknown (tmp)) {
|
||||
g_free (tmp);
|
||||
return;
|
||||
}
|
||||
|
||||
mimetype = g_content_type_get_mime_type (tmp);
|
||||
g_free (tmp);
|
||||
|
||||
if (mimetype == NULL)
|
||||
return;
|
||||
|
||||
GST_DEBUG ("Got mimetype '%s'", mimetype);
|
||||
|
||||
/* Ignore audio/video types:
|
||||
* - our own typefinders in -base are likely to be better at this
|
||||
* (and if they're not, we really want to fix them, that's why we don't
|
||||
* report xdg-detected audio/video types at all, not even with a low
|
||||
* probability)
|
||||
* - we want to detect GStreamer media types and not MIME types
|
||||
* - the purpose of this xdg mime finder is mainly to prevent false
|
||||
* positives of non-media formats, not to typefind audio/video formats */
|
||||
if (g_str_has_prefix (mimetype, "audio/") ||
|
||||
g_str_has_prefix (mimetype, "video/")) {
|
||||
GST_LOG ("Ignoring audio/video mime type");
|
||||
g_free (mimetype);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Again, we mainly want the xdg typefinding to prevent false-positives on
|
||||
* non-media formats, so suggest the type with a probability that trumps
|
||||
* uncertain results of our typefinders, but not more than that. */
|
||||
GST_LOG ("Suggesting '%s' with probability POSSIBLE", mimetype);
|
||||
gst_type_find_suggest_simple (find, GST_TYPE_FIND_POSSIBLE, mimetype, NULL);
|
||||
g_free (mimetype);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
gboolean ret;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (xdgmime_debug, "xdgmime", 0, "XDG-MIME");
|
||||
|
||||
ret = gst_type_find_register (plugin,
|
||||
"xdgmime", GST_RANK_MARGINAL, xdgmime_typefind, NULL, NULL, NULL, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"xdgmime",
|
||||
"XDG-MIME",
|
||||
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
Loading…
Reference in a new issue