diff options
author | Benjamin Otte <otte@gnome.org> | 2003-11-02 19:28:08 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-11-02 19:28:08 +0000 |
commit | 302cf767d9ce10576be370c5266f40f088a63ba6 (patch) | |
tree | d7381b1b6effde83202fd121a69507be2a897725 /gst/wavenc/gstwavenc.c | |
parent | 9c852c63491d5cc99010e9fdd8d9a489406f7c6e (diff) |
fix to new plugin system
Original commit message from CVS:
fix to new plugin system
Diffstat (limited to 'gst/wavenc/gstwavenc.c')
-rw-r--r-- | gst/wavenc/gstwavenc.c | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/gst/wavenc/gstwavenc.c b/gst/wavenc/gstwavenc.c index 742cafa1..3ae12e07 100644 --- a/gst/wavenc/gstwavenc.c +++ b/gst/wavenc/gstwavenc.c @@ -27,6 +27,7 @@ #include <gstwavenc.h> #include <riff.h> +static void gst_wavenc_base_init (gpointer g_class); static void gst_wavenc_class_init (GstWavEncClass *klass); static void gst_wavenc_init (GstWavEnc *wavenc); static void gst_wavenc_chain (GstPad *pad, GstData *_data); @@ -68,15 +69,12 @@ struct wave_header { struct chunk_struct data; }; -static GstElementDetails gst_wavenc_details = { +static GstElementDetails gst_wavenc_details = GST_ELEMENT_DETAILS ( "WAV encoder", "Codec/Audio/Encoder", - "LGPL", "Encode raw audio into WAV", - VERSION, - "Iain Holmes <iain@prettypeople.org>", - "(C) 2002", -}; + "Iain Holmes <iain@prettypeople.org>" +); static GstPadTemplate *srctemplate, *sinktemplate; @@ -128,7 +126,7 @@ gst_wavenc_get_type (void) if (type == 0) { static const GTypeInfo info = { sizeof (GstWavEncClass), - NULL, + gst_wavenc_base_init, NULL, (GClassInitFunc) gst_wavenc_class_init, NULL, @@ -186,6 +184,19 @@ set_property (GObject *object, } static void +gst_wavenc_base_init (gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &gst_wavenc_details); + + srctemplate = src_factory (); + gst_element_class_add_pad_template (element_class, srctemplate); + + sinktemplate = sink_factory (); + gst_element_class_add_pad_template (element_class, sinktemplate); +} +static void gst_wavenc_class_init (GstWavEncClass *klass) { GstElementClass *element_class; @@ -642,29 +653,21 @@ gst_wavenc_chain (GstPad *pad, } static gboolean -plugin_init (GModule *module, - GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - - factory = gst_element_factory_new ("wavenc", GST_TYPE_WAVENC, - &gst_wavenc_details); - - srctemplate = src_factory (); - gst_element_factory_add_pad_template (factory, srctemplate); - - sinktemplate = sink_factory (); - gst_element_factory_add_pad_template (factory, sinktemplate); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register (plugin, "wavenc", GST_RANK_NONE, GST_TYPE_WAVENC); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "wavenc", - plugin_init -}; + "Encode raw audio into WAV", + plugin_init, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) |