diff options
author | Benjamin Otte <otte@gnome.org> | 2003-11-03 15:48:38 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-11-03 15:48:38 +0000 |
commit | dd3d4e08ae8d9d1fdf0bc063f29a1000a2cdbd96 (patch) | |
tree | 8a41dce7a918728b6f16a58acb9efc58f2c09cd0 /ext | |
parent | e1a1e2da8dc9b13d23283309780a826e9e341bdd (diff) | |
download | gst-plugins-bad-dd3d4e08ae8d9d1fdf0bc063f29a1000a2cdbd96.tar.gz gst-plugins-bad-dd3d4e08ae8d9d1fdf0bc063f29a1000a2cdbd96.tar.bz2 gst-plugins-bad-dd3d4e08ae8d9d1fdf0bc063f29a1000a2cdbd96.zip |
fix for new plugin system
Original commit message from CVS:
fix for new plugin system
Diffstat (limited to 'ext')
-rw-r--r-- | ext/swfdec/gstswfdec.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/ext/swfdec/gstswfdec.c b/ext/swfdec/gstswfdec.c index 78ed29b4..762a5247 100644 --- a/ext/swfdec/gstswfdec.c +++ b/ext/swfdec/gstswfdec.c @@ -25,15 +25,12 @@ #include <string.h> /* elementfactory information */ -static GstElementDetails gst_swfdec_details = { +static GstElementDetails gst_swfdec_details = GST_ELEMENT_DETAILS ( "SWF video decoder", "Codec/Video/Decoder", - "LGPL", "Uses libswfdec to decode Flash video streams", - VERSION, - "David Schleef <ds@schleef.org>", - "(C) 2002", -}; + "David Schleef <ds@schleef.org>" +); /* Swfdec signals and args */ enum { @@ -92,6 +89,7 @@ GST_PAD_TEMPLATE_FACTORY (sink_template_factory, ) ); +static void gst_swfdec_base_init (gpointer g_class); static void gst_swfdec_class_init (GstSwfdecClass *klass); static void gst_swfdec_init (GstSwfdec *swfdec); @@ -128,7 +126,7 @@ gst_swfdec_get_type (void) if (!swfdec_type) { static const GTypeInfo swfdec_info = { sizeof(GstSwfdecClass), - NULL, + gst_swfdec_base_init, NULL, (GClassInitFunc)gst_swfdec_class_init, NULL, @@ -143,6 +141,20 @@ gst_swfdec_get_type (void) } static void +gst_swfdec_base_init(gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &gst_swfdec_details); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (video_template_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (audio_template_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (sink_template_factory)); +} +static void gst_swfdec_class_init(GstSwfdecClass *klass) { GObjectClass *gobject_class; @@ -627,31 +639,20 @@ gst_swfdec_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 swfdec element */ - factory = gst_element_factory_new("swfdec",GST_TYPE_SWFDEC, - &gst_swfdec_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 (video_template_factory)); - gst_element_factory_add_pad_template (factory, - GST_PAD_TEMPLATE_GET (audio_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, "swfdec", GST_RANK_PRIMARY, GST_TYPE_SWFDEC); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "swfdec", - plugin_init -}; + "Uses libswfdec to decode Flash video streams", + plugin_init, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) |