diff options
author | Benjamin Otte <otte@gnome.org> | 2003-10-28 20:52:41 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-10-28 20:52:41 +0000 |
commit | c9ae463a4f5c81e7c2a5f9c943480a89685e9be4 (patch) | |
tree | 54a66bf2f5ef869347b738b84a374a077de9d30b /ext/flac/gstflac.c | |
parent | c4aacdb8e51ceb82f11b6b608aacaffc036d1fb2 (diff) |
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
Diffstat (limited to 'ext/flac/gstflac.c')
-rw-r--r-- | ext/flac/gstflac.c | 41 |
1 files changed, 3 insertions, 38 deletions
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; } |