From: Ronald S. Bultje Date: Sun, 8 Jun 2003 13:30:59 +0000 (+0000) Subject: Remove typefinding as separate plugin, this is part of the demuxers now X-Git-Tag: BRANCH-ERROR-ROOT~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b1645814e4026694a7eaad57d7c43716d643cf4;p=platform%2Fupstream%2Fgst-libav.git Remove typefinding as separate plugin, this is part of the demuxers now Original commit message from CVS: Remove typefinding as separate plugin, this is part of the demuxers now --- diff --git a/ext/ffmpeg/Makefile.am b/ext/ffmpeg/Makefile.am index 118f534..e4c4f60 100644 --- a/ext/ffmpeg/Makefile.am +++ b/ext/ffmpeg/Makefile.am @@ -8,8 +8,7 @@ libgstffmpeg_la_SOURCES = gstffmpeg.c \ gstffmpegdemux.c \ gstffmpegenc.c \ gstffmpegmux.c \ - gstffmpegprotocol.c \ - gstffmpegtypes.c + gstffmpegprotocol.c libgstffmpeg_la_CFLAGS = $(GST_CFLAGS) \ -I $(top_builddir)/gst-libs/ext/ffmpeg/ffmpeg/libavcodec \ diff --git a/ext/ffmpeg/gstffmpeg.c b/ext/ffmpeg/gstffmpeg.c index af1acfa..c4bfa45 100644 --- a/ext/ffmpeg/gstffmpeg.c +++ b/ext/ffmpeg/gstffmpeg.c @@ -52,7 +52,6 @@ plugin_init (GModule *module, GstPlugin *plugin) gst_ffmpegenc_register (plugin); gst_ffmpegdec_register (plugin); gst_ffmpegdemux_register (plugin); - gst_ffmpegtypes_register (plugin); register_protocol (&gstreamer_protocol); diff --git a/ext/ffmpeg/gstffmpegtypes.c b/ext/ffmpeg/gstffmpegtypes.c deleted file mode 100644 index cc95ca6..0000000 --- a/ext/ffmpeg/gstffmpegtypes.c +++ /dev/null @@ -1,136 +0,0 @@ -/* GStreamer - * Copyright (C) <1999> Erik Walthinsen - * - * 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. - */ - -#include -#include -#include "config.h" -#ifdef HAVE_FFMPEG_UNINSTALLED -#include -#else -#include -#endif - -#include - -static GHashTable *global_types = NULL; - -extern GstCaps* gst_ffmpegcodec_codec_context_to_caps (AVCodecContext *ctx, int id); - -static GstCaps* -gst_ffmpegtypes_typefind (GstBuffer *buffer, gpointer priv) -{ - AVInputFormat *in_plugin; - AVInputFormat *highest = NULL; - gint max = 0; - gint res = 0; - - in_plugin = first_iformat; - - while (in_plugin) { - if (in_plugin->read_probe) { - AVProbeData probe_data; - - probe_data.filename = ""; - probe_data.buf = GST_BUFFER_DATA (buffer); - probe_data.buf_size = GST_BUFFER_SIZE (buffer); - - res = in_plugin->read_probe (&probe_data); - if (res > max) { - max = res; - highest = in_plugin; - } - } - in_plugin = in_plugin->next; - } - if (highest) { - GstCaps *caps; - caps = g_hash_table_lookup (global_types, highest->name); - /* make sure we still hold a refcount to this caps */ - gst_caps_ref (caps); - return caps; - } - - return NULL; -} - -#define ADD_TYPE(key,caps) g_hash_table_insert (global_types, (key), (caps)) - -static void -register_standard_formats (void) -{ - global_types = g_hash_table_new (g_str_hash, g_str_equal); - - ADD_TYPE ("avi", GST_CAPS_NEW ("ffmpeg_type_avi", "video/avi", NULL)); - ADD_TYPE ("mpeg", GST_CAPS_NEW ("ffmpeg_type_mpeg", "video/mpeg", - "systemstream", GST_PROPS_BOOLEAN (TRUE))); - ADD_TYPE ("mpegts", GST_CAPS_NEW ("ffmpeg_type_mpegts", "video/x-mpegts", - "systemstream", GST_PROPS_BOOLEAN (TRUE))); - ADD_TYPE ("rm", GST_CAPS_NEW ("ffmpeg_type_rm", "audio/x-pn-realaudio", NULL)); - ADD_TYPE ("asf", GST_CAPS_NEW ("ffmpeg_type_asf", "video/x-ms-asf", NULL)); - ADD_TYPE ("avi", GST_CAPS_NEW ("ffmpeg_type_avi", "video/avi", - "format", GST_PROPS_STRING ("AVI"))); - ADD_TYPE ("mov", GST_CAPS_NEW ("ffmpeg_type_mov", "video/quicktime", NULL)); - ADD_TYPE ("swf", GST_CAPS_NEW ("ffmpeg_type_swf", "application/x-shockwave-flash", NULL)); - ADD_TYPE ("au", GST_CAPS_NEW ("ffmpeg_type_au", "audio/basic", NULL)); - ADD_TYPE ("mov", GST_CAPS_NEW ("ffmpeg_type_mov", "video/quicktime", NULL)); -} - -gboolean -gst_ffmpegtypes_register (GstPlugin *plugin) -{ - AVInputFormat *in_plugin; - GstTypeFactory *factory; - GstTypeDefinition *definition; - - in_plugin = first_iformat; - - while (in_plugin) { - gchar *type_name; - gchar *p; - - if (!in_plugin->read_probe) - goto next; - - /* construct the type */ - type_name = g_strdup_printf("fftype_%s", in_plugin->name); - - p = type_name; - - while (*p) { - if (*p == '.') *p = '_'; - p++; - } - - definition = g_new0 (GstTypeDefinition, 1); - definition->name = type_name; - definition->mime = type_name; - definition->exts = g_strdup (in_plugin->extensions); - definition->typefindfunc = gst_ffmpegtypes_typefind; - - factory = gst_type_factory_new (definition); - - /* The very last thing is to register the elementfactory with the plugin. */ - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); -next: - in_plugin = in_plugin->next; - } - register_standard_formats (); - - return TRUE; -}