From eebceb0d906979a5d9036fb926a1350b82b00542 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 4 Nov 2003 04:26:26 +0000 Subject: [PATCH] update for new plugin API. still fails. Original commit message from CVS: update for new plugin API. still fails. --- tests/old/testsuite/dynparams/dparamstest.c | 61 +++++++++++++++------ testsuite/dynparams/dparamstest.c | 61 +++++++++++++++------ 2 files changed, 90 insertions(+), 32 deletions(-) diff --git a/tests/old/testsuite/dynparams/dparamstest.c b/tests/old/testsuite/dynparams/dparamstest.c index 6f1fbb2226..160afe313b 100644 --- a/tests/old/testsuite/dynparams/dparamstest.c +++ b/tests/old/testsuite/dynparams/dparamstest.c @@ -21,6 +21,7 @@ #include #include +#include #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -58,23 +59,13 @@ struct _GstDpTestClass GType gst_dptest_get_type (void); - -GstElementDetails gst_dptest_details = { - "DParamsTest", - "Filter", - "LGPL", - "Test for the GstDParam code", - VERSION, - "Steve Baker ", - "(C) 2001", -}; - enum { ARG_0, }; +static void gst_dptest_base_init (gpointer g_class); static void gst_dptest_class_init (GstDpTestClass * klass); static void gst_dptest_init (GstDpTest * dptest); @@ -93,7 +84,8 @@ gst_dptest_get_type (void) if (!dptest_type) { static const GTypeInfo dptest_info = { - sizeof (GstDpTestClass), NULL, + sizeof (GstDpTestClass), + gst_dptest_base_init, NULL, (GClassInitFunc) gst_dptest_class_init, NULL, @@ -108,6 +100,22 @@ gst_dptest_get_type (void) return dptest_type; } +static void +gst_dptest_base_init (gpointer g_class) +{ + static GstElementDetails dptest_details = GST_ELEMENT_DETAILS ( + "DParamTest", + "Filter", + "Test for the GstDParam code", + "Steve Baker " + ); + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &dptest_details); + + g_print("got here %d\n",__LINE__); +} + static void gst_dptest_class_init (GstDpTestClass * klass) { @@ -198,9 +206,29 @@ gst_dptest_chain (GstPad *pad, GstData *data) g_print("dp chain\n"); } +gboolean +gst_dptest_register_elements (GstPlugin *plugin) +{ + return gst_element_register (plugin, "dptest", GST_RANK_NONE, + GST_TYPE_DPTEST); +} + +static GstPluginDesc plugin_desc = { + GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "dptest_elements", + "test elements", + &gst_dptest_register_elements, + NULL, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +}; + int main(int argc,char *argv[]) { - GstElementFactory *factory; GstElement *src; GstElement *sink; GstElement *testelement; @@ -209,11 +237,12 @@ int main(int argc,char *argv[]) { GstDParam *dp_float1; GValue *dp_float1_value; + alarm(10); + gst_init (&argc, &argv); gst_control_init(&argc,&argv); - - factory = gst_element_factory_new ("dptest", GST_TYPE_DPTEST, &gst_dptest_details); - g_assert (factory != NULL); + + _gst_plugin_register_static (&plugin_desc); pipeline = gst_element_factory_make ("pipeline", "pipeline"); g_assert (pipeline); diff --git a/testsuite/dynparams/dparamstest.c b/testsuite/dynparams/dparamstest.c index 6f1fbb2226..160afe313b 100644 --- a/testsuite/dynparams/dparamstest.c +++ b/testsuite/dynparams/dparamstest.c @@ -21,6 +21,7 @@ #include #include +#include #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -58,23 +59,13 @@ struct _GstDpTestClass GType gst_dptest_get_type (void); - -GstElementDetails gst_dptest_details = { - "DParamsTest", - "Filter", - "LGPL", - "Test for the GstDParam code", - VERSION, - "Steve Baker ", - "(C) 2001", -}; - enum { ARG_0, }; +static void gst_dptest_base_init (gpointer g_class); static void gst_dptest_class_init (GstDpTestClass * klass); static void gst_dptest_init (GstDpTest * dptest); @@ -93,7 +84,8 @@ gst_dptest_get_type (void) if (!dptest_type) { static const GTypeInfo dptest_info = { - sizeof (GstDpTestClass), NULL, + sizeof (GstDpTestClass), + gst_dptest_base_init, NULL, (GClassInitFunc) gst_dptest_class_init, NULL, @@ -108,6 +100,22 @@ gst_dptest_get_type (void) return dptest_type; } +static void +gst_dptest_base_init (gpointer g_class) +{ + static GstElementDetails dptest_details = GST_ELEMENT_DETAILS ( + "DParamTest", + "Filter", + "Test for the GstDParam code", + "Steve Baker " + ); + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &dptest_details); + + g_print("got here %d\n",__LINE__); +} + static void gst_dptest_class_init (GstDpTestClass * klass) { @@ -198,9 +206,29 @@ gst_dptest_chain (GstPad *pad, GstData *data) g_print("dp chain\n"); } +gboolean +gst_dptest_register_elements (GstPlugin *plugin) +{ + return gst_element_register (plugin, "dptest", GST_RANK_NONE, + GST_TYPE_DPTEST); +} + +static GstPluginDesc plugin_desc = { + GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "dptest_elements", + "test elements", + &gst_dptest_register_elements, + NULL, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +}; + int main(int argc,char *argv[]) { - GstElementFactory *factory; GstElement *src; GstElement *sink; GstElement *testelement; @@ -209,11 +237,12 @@ int main(int argc,char *argv[]) { GstDParam *dp_float1; GValue *dp_float1_value; + alarm(10); + gst_init (&argc, &argv); gst_control_init(&argc,&argv); - - factory = gst_element_factory_new ("dptest", GST_TYPE_DPTEST, &gst_dptest_details); - g_assert (factory != NULL); + + _gst_plugin_register_static (&plugin_desc); pipeline = gst_element_factory_make ("pipeline", "pipeline"); g_assert (pipeline);