fix for new plugin system

Original commit message from CVS:
fix for new plugin system
This commit is contained in:
Benjamin Otte 2003-11-02 22:34:11 +00:00
parent c51e5a23c3
commit c37952c970
5 changed files with 105 additions and 90 deletions

View file

@ -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,
@ -84,6 +83,13 @@ gst_spectrum_get_type (void)
return spectrum_type;
}
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)
{
@ -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
)

View file

@ -36,15 +36,12 @@
#define SPEED_NUMBUF 6
/* elementfactory information */
static GstElementDetails speed_details = {
static GstElementDetails speed_details = GST_ELEMENT_DETAILS (
"Speed",
"Filter/Audio/Effect",
"LGPL",
"Set speed/pitch on audio/raw streams (resampler)",
VERSION,
"Andy Wingo <apwingo@eos.ncsu.edu>",
"(C) 2001"
};
"Andy Wingo <apwingo@eos.ncsu.edu>"
);
/* Filter signals and args */
@ -102,6 +99,7 @@ speed_sink_get_bufferpool (GstPad *pad)
return filter->sinkpool;
}
static void speed_base_init (gpointer g_class);
static void speed_class_init (GstSpeedClass *klass);
static void speed_init (GstSpeed *filter);
@ -170,7 +168,8 @@ gst_speed_get_type(void) {
if (!speed_type) {
static const GTypeInfo speed_info = {
sizeof(GstSpeedClass), NULL,
sizeof(GstSpeedClass),
speed_base_init,
NULL,
(GClassInitFunc)speed_class_init,
NULL,
@ -184,6 +183,16 @@ gst_speed_get_type(void) {
return speed_type;
}
static void
speed_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &speed_details);
gst_element_class_add_pad_template (element_class, speed_src_factory ());
gst_element_class_add_pad_template (element_class, speed_sink_factory ());
}
static void
speed_class_init (GstSpeedClass *klass)
{
@ -303,24 +312,20 @@ speed_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p
}
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
plugin_init (GstPlugin *plugin)
{
GstElementFactory *factory;
factory = gst_element_factory_new("speed", GST_TYPE_SPEED, &speed_details);
g_return_val_if_fail(factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, speed_src_factory ());
gst_element_factory_add_pad_template (factory, speed_sink_factory ());
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
return gst_element_register(plugin, "speed", GST_RANK_NONE, GST_TYPE_SPEED);
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"speed",
plugin_init
};
"Set speed/pitch on audio/raw streams (resampler)",
plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -1,3 +0,0 @@
This effect is borrowed from xmms-0.6.1, though I mangled it so badly in
the process of copying it over that the xmms people probably won't want
any credit for it ;-)

View file

@ -17,21 +17,23 @@
* Boston, MA 02111-1307, USA.
*/
/* This effect is borrowed from xmms-0.6.1, though I mangled it so badly in
* the process of copying it over that the xmms people probably won't want
* any credit for it ;-)
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gststereo.h>
/* elementfactory information */
static GstElementDetails stereo_details = {
static GstElementDetails stereo_details = GST_ELEMENT_DETAILS (
"Stereo effect",
"Filter/Audio/Effect",
"LGPL",
"Muck with the stereo signal, enhance it's 'stereo-ness'",
VERSION,
"Erik Walthinsen <omega@cse.ogi.edu>",
"(C) 1999",
};
"Erik Walthinsen <omega@cse.ogi.edu>"
);
/* Stereo signals and args */
@ -47,6 +49,7 @@ enum {
};
static void gst_stereo_base_init (gpointer g_class);
static void gst_stereo_class_init (GstStereoClass *klass);
static void gst_stereo_init (GstStereo *stereo);
@ -64,7 +67,8 @@ gst_stereo_get_type(void) {
if (!stereo_type) {
static const GTypeInfo stereo_info = {
sizeof(GstStereoClass), NULL,
sizeof(GstStereoClass),
gst_stereo_base_init,
NULL,
(GClassInitFunc)gst_stereo_class_init,
NULL,
@ -78,6 +82,12 @@ gst_stereo_get_type(void) {
return stereo_type;
}
static void
gst_stereo_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &stereo_details);
}
static void
gst_stereo_class_init (GstStereoClass *klass)
{
@ -210,22 +220,21 @@ gst_stereo_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
}
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
plugin_init (GstPlugin *plugin)
{
GstElementFactory *factory;
factory = gst_element_factory_new("stereo",GST_TYPE_STEREO,
&stereo_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, "stereo", GST_RANK_NONE, GST_TYPE_STEREO);
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"stereo",
plugin_init
};
"Muck with the stereo signal, enhance it's 'stereo-ness'",
plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -63,15 +63,12 @@ struct _GstVBIDecClass {
GType gst_vbidec_get_type(void);
/* elementfactory information */
static GstElementDetails gst_vbidec_details = {
static GstElementDetails gst_vbidec_details = GST_ELEMENT_DETAILS (
"VBI decoder",
"Codec/Video/Decoder",
"GPL",
"Decodes closed captions and XDS data from VBI data",
VERSION,
"David I. Lehn <dlehn@users.sourceforge.net>",
"(C) 2002"
};
"David I. Lehn <dlehn@users.sourceforge.net>"
);
/* VBIDec signals and args */
enum {
@ -131,6 +128,7 @@ gst_vbidec_caption_type_get_type (void)
return vbidec_caption_type_type;
}
static void gst_vbidec_base_init (gpointer g_class);
static void gst_vbidec_class_init (GstVBIDecClass *klass);
static void gst_vbidec_init (GstVBIDec *vbidec);
@ -152,7 +150,7 @@ gst_vbidec_get_type (void)
if (!vbidec_type) {
static const GTypeInfo vbidec_info = {
sizeof(GstVBIDecClass),
NULL,
gst_vbidec_base_init,
NULL,
(GClassInitFunc)gst_vbidec_class_init,
NULL,
@ -166,6 +164,16 @@ gst_vbidec_get_type (void)
return vbidec_type;
}
static void
gst_vbidec_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &gst_vbidec_details);
gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (src_template_factory));
gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (sink_template_factory));
}
static void
gst_vbidec_class_init(GstVBIDecClass *klass)
{
@ -358,27 +366,20 @@ gst_vbidec_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
}
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
plugin_init (GstPlugin *plugin)
{
GstElementFactory *factory;
/* create an elementfactory for the vbidec element */
factory = gst_element_factory_new("vbidec",GST_TYPE_VBIDEC,
&gst_vbidec_details);
g_return_val_if_fail(factory != NULL, FALSE);
gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_PRIMARY);
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (src_template_factory));
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_template_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
return gst_element_register (plugin, "vbidec", GST_RANK_NONE, GST_TYPE_VBIDEC);
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"vbidec",
plugin_init
};
"Decodes closed captions and XDS data from VBI data",
plugin_init,
VERSION,
"GPL",
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)