diff options
author | Benjamin Otte <otte@gnome.org> | 2003-11-02 22:34:11 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-11-02 22:34:11 +0000 |
commit | c37952c970ea1031fca6a8cca6d90e4686775506 (patch) | |
tree | d34d8ef2cd6afb69c55187f18600b34bc416f5f3 /gst/spectrum/gstspectrum.c | |
parent | c51e5a23c3cf288d8a20bdba73eebedf2cdb3a0a (diff) | |
download | gst-plugins-bad-c37952c970ea1031fca6a8cca6d90e4686775506.tar.gz gst-plugins-bad-c37952c970ea1031fca6a8cca6d90e4686775506.tar.bz2 gst-plugins-bad-c37952c970ea1031fca6a8cca6d90e4686775506.zip |
fix for new plugin system
Original commit message from CVS:
fix for new plugin system
Diffstat (limited to 'gst/spectrum/gstspectrum.c')
-rw-r--r-- | gst/spectrum/gstspectrum.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c index 5a2e8eb9..eab15fe1 100644 --- a/gst/spectrum/gstspectrum.c +++ b/gst/spectrum/gstspectrum.c @@ -25,15 +25,12 @@ #include "gstspectrum.h" /* elementfactory information */ -static GstElementDetails gst_spectrum_details = { +static GstElementDetails gst_spectrum_details = GST_ELEMENT_DETAILS ( "Spectrum analyzer", "Filter/Audio/Analysis", - "LGPL", "Run an FFT on the audio signal, output spectrum data", - VERSION, - "Erik Walthinsen <omega@cse.ogi.edu>", - "(C) 1999", -}; + "Erik Walthinsen <omega@cse.ogi.edu>" +); /* Spectrum signals and args */ enum { @@ -47,6 +44,7 @@ enum { }; +static void gst_spectrum_base_init (gpointer g_class); static void gst_spectrum_class_init (GstSpectrumClass *klass); static void gst_spectrum_init (GstSpectrum *spectrum); @@ -70,7 +68,8 @@ gst_spectrum_get_type (void) if (!spectrum_type) { static const GTypeInfo spectrum_info = { - sizeof(GstSpectrumClass), NULL, + sizeof(GstSpectrumClass), + gst_spectrum_base_init, NULL, (GClassInitFunc)gst_spectrum_class_init, NULL, @@ -85,6 +84,13 @@ gst_spectrum_get_type (void) } static void +gst_spectrum_base_init (gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &gst_spectrum_details); +} +static void gst_spectrum_class_init (GstSpectrumClass *klass) { GObjectClass *gobject_class; @@ -193,23 +199,20 @@ gst_spectrum_chain (GstPad *pad, GstData *_data) } static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - - /* create an elementfactory for the spectrum element */ - factory = gst_element_factory_new ("spectrum",GST_TYPE_SPECTRUM, - &gst_spectrum_details); - g_return_val_if_fail (factory != NULL, FALSE); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register (plugin, "spectrum", GST_RANK_NONE, GST_TYPE_SPECTRUM); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "spectrum", - plugin_init -}; + "Run an FFT on the audio signal, output spectrum data", + plugin_init, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) |