From c9ae463a4f5c81e7c2a5f9c943480a89685e9be4 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 28 Oct 2003 20:52:41 +0000 Subject: merge TYPEFIND branch. Major changes: Original commit message from CVS: merge TYPEFIND branch. Major changes: - totally reworked type(find) system - all typefind functions are in gst/typefind now - more typefind functions then before - some plugins might fail to compile now because I don't have them installed and they a) require bytestream or b) haven't had their typefind fixed. Please fix those plugins and put the typefind functions into gst/typefind if they don't have dependencies --- ext/dv/gstdvdec.c | 3 +++ ext/dv/gstdvdec.h | 2 +- ext/flac/gstflac.c | 41 +++-------------------------------------- ext/flac/gstflacdec.h | 2 +- ext/ladspa/gstladspa.h | 2 +- 5 files changed, 9 insertions(+), 41 deletions(-) (limited to 'ext') diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index ecaa9736..68ff1484 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -1006,6 +1006,9 @@ plugin_init (GModule *module, GstPlugin *plugin) GstElementFactory *factory; GstTypeFactory *type; + if (!gst_library_load ("gstbytestream")) + return FALSE; + /* We need to create an ElementFactory for each element we provide. * This consists of the name of the element, the GType identifier, * and a pointer to the details structure at the top of the file. diff --git a/ext/dv/gstdvdec.h b/ext/dv/gstdvdec.h index cced0803..14525d1a 100644 --- a/ext/dv/gstdvdec.h +++ b/ext/dv/gstdvdec.h @@ -29,7 +29,7 @@ extern "C" { #include -#include +#include /* This is the definition of the element's object structure. */ diff --git a/ext/flac/gstflac.c b/ext/flac/gstflac.c index 7393ef89..b4e9ccec 100644 --- a/ext/flac/gstflac.c +++ b/ext/flac/gstflac.c @@ -26,8 +26,6 @@ extern GstElementDetails flacenc_details; extern GstElementDetails flacdec_details; -static GstCaps* flac_type_find (GstByteStream *bs, gpointer private); - GstPadTemplate *gst_flacdec_src_template, *gst_flacdec_sink_template; GstPadTemplate *gst_flacenc_src_template, *gst_flacenc_sink_template; @@ -61,45 +59,15 @@ raw_caps_factory (void) NULL)); } -static GstTypeDefinition flacdefinition = { - "flac_audio/x-flac", - "audio/x-flac", - ".flac", - flac_type_find, -}; - - -static GstCaps* -flac_type_find (GstByteStream *bs, gpointer private) -{ - GstBuffer *buf = NULL; - GstCaps *new = NULL; - - if (gst_bytestream_peek (bs, &buf, 4) == 4) { - guint32 head = GUINT32_FROM_BE (*((guint32 *) GST_BUFFER_DATA (buf))); - - if (head == 0x664C6143) { - new = GST_CAPS_NEW ("flac_type_find", - "application/x-flac", - NULL); - } - } - - if (buf != NULL) { - gst_buffer_unref (buf); - } - - return new; -} - - static gboolean plugin_init (GModule *module, GstPlugin *plugin) { GstElementFactory *enc, *dec; - GstTypeFactory *type; GstCaps *raw_caps, *flac_caps; + if (!gst_library_load ("gstbytestream")) + return FALSE; + gst_plugin_set_longname (plugin, "The FLAC Lossless compressor Codec"); /* create an elementfactory for the flacenc element */ @@ -144,9 +112,6 @@ plugin_init (GModule *module, GstPlugin *plugin) gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (dec)); - type = gst_type_factory_new (&flacdefinition); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (type)); - return TRUE; } diff --git a/ext/flac/gstflacdec.h b/ext/flac/gstflacdec.h index 0b374440..01930dc7 100644 --- a/ext/flac/gstflacdec.h +++ b/ext/flac/gstflacdec.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include diff --git a/ext/ladspa/gstladspa.h b/ext/ladspa/gstladspa.h index 85348a95..a33062ff 100644 --- a/ext/ladspa/gstladspa.h +++ b/ext/ladspa/gstladspa.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include "ladspa.h" -- cgit