From 73fca8b4b6255349139909b23c336b2c6ca791b5 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 2 Nov 2003 22:23:26 +0000 Subject: Again one done Original commit message from CVS: Again one done --- gst/smooth/gstsmooth.c | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'gst/smooth/gstsmooth.c') diff --git a/gst/smooth/gstsmooth.c b/gst/smooth/gstsmooth.c index 0051ca1d..285b02de 100644 --- a/gst/smooth/gstsmooth.c +++ b/gst/smooth/gstsmooth.c @@ -28,11 +28,8 @@ static GstElementDetails smooth_details = { "Smooth effect", "Filter/Video", - "LGPL", "Apply a smooth filter to an image", - VERSION, - "Wim Taymans ", - "(C) 2000", + "Wim Taymans " }; @@ -75,6 +72,7 @@ GST_PAD_TEMPLATE_FACTORY (smooth_sink_factory, ) static void gst_smooth_class_init (GstSmoothClass *klass); +static void gst_smooth_base_init (GstSmoothClass *klass); static void gst_smooth_init (GstSmooth *smooth); static void gst_smooth_chain (GstPad *pad, GstData *_data); @@ -94,7 +92,8 @@ gst_smooth_get_type (void) if (!smooth_type) { static const GTypeInfo smooth_info = { - sizeof(GstSmoothClass), NULL, + sizeof(GstSmoothClass), + (GBaseInitFunc)gst_smooth_base_init, NULL, (GClassInitFunc)gst_smooth_class_init, NULL, @@ -108,6 +107,18 @@ gst_smooth_get_type (void) return smooth_type; } +static void +gst_smooth_base_init (GstSmoothClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (smooth_sink_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (smooth_src_factory)); + gst_element_class_set_details (element_class, &smooth_details); +} + static void gst_smooth_class_init (GstSmoothClass *klass) { @@ -326,26 +337,21 @@ gst_smooth_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("smooth",GST_TYPE_SMOOTH, - &smooth_details); - g_return_val_if_fail(factory != NULL, FALSE); - - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (smooth_sink_factory)); - gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (smooth_src_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); - - return TRUE; + return gst_element_register(plugin, "smooth", + GST_RANK_NONE, GST_TYPE_SMOOTH); } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "smooth", - plugin_init -}; - + "Apply a smooth filter to an image", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) -- cgit v1.2.1