From 8cf23985358eab8d7b6db7115387474268ffe384 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 2 Nov 2003 05:39:26 +0000 Subject: Updated for the new plugin loading code Original commit message from CVS: Updated for the new plugin loading code --- gst/deinterlace/gstdeinterlace.c | 50 +++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'gst') diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index 81384d81..27a112fc 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -30,11 +30,8 @@ static GstElementDetails deinterlace_details = { "Deinterlace", "Filter/Video", - "LGPL", "Deinterlace video", - VERSION, - "Wim Taymans ", - "(C) 2001", + "Wim Taymans " }; @@ -82,6 +79,7 @@ GST_PAD_TEMPLATE_FACTORY (deinterlace_sink_factory, static GType gst_deinterlace_get_type (void); +static void gst_deinterlace_base_init (gpointer g_class); static void gst_deinterlace_class_init (GstDeInterlaceClass *klass); static void gst_deinterlace_init (GstDeInterlace *filter); @@ -101,7 +99,8 @@ gst_deinterlace_get_type(void) { if (!deinterlace_type) { static const GTypeInfo deinterlace_info = { - sizeof(GstDeInterlaceClass), NULL, + sizeof(GstDeInterlaceClass), + gst_deinterlace_base_init, NULL, (GClassInitFunc)gst_deinterlace_class_init, NULL, @@ -115,6 +114,19 @@ gst_deinterlace_get_type(void) { return deinterlace_type; } +static void +gst_deinterlace_base_init (gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (deinterlace_src_factory)); + gst_element_class_add_pad_template (element_class, + GST_PAD_TEMPLATE_GET (deinterlace_sink_factory)); + + gst_element_class_set_details (element_class, &deinterlace_details); +} + static void gst_deinterlace_class_init (GstDeInterlaceClass *klass) { @@ -358,27 +370,23 @@ gst_deinterlace_get_property (GObject *object, guint prop_id, GValue *value, GPa } static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *factory; - - factory = gst_element_factory_new("deinterlace",GST_TYPE_DEINTERLACE, - &deinterlace_details); - g_return_val_if_fail(factory != NULL, FALSE); - - gst_element_factory_add_pad_template (factory, - GST_PAD_TEMPLATE_GET (deinterlace_src_factory)); - gst_element_factory_add_pad_template (factory, - GST_PAD_TEMPLATE_GET (deinterlace_sink_factory)); - - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); + if (!gst_element_register (plugin, "deinterlace", GST_RANK_NONE, gst_deinterlace_get_type())) + return FALSE; return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "deinterlace", - plugin_init -}; + "Deinterlace video", + plugin_init, + VERSION, + "LGPL", + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +); -- cgit v1.2.1