diff --git a/gst/tcp/gsttcp.c b/gst/tcp/gsttcp.c index 1b7f57aeed..60e7d7943b 100644 --- a/gst/tcp/gsttcp.c +++ b/gst/tcp/gsttcp.c @@ -21,32 +21,27 @@ #include "gsttcpsrc.h" #include "gsttcpsink.h" -/* elementfactory information */ -extern GstElementDetails gst_tcpsrc_details; -extern GstElementDetails gst_tcpsink_details; - static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *src, *sink; + if (!gst_element_register (plugin, "tcpsink", GST_RANK_NONE, GST_TYPE_TCPSINK)) + return FALSE; - /* create an elementfactory for the tcpsrc element */ - sink = gst_element_factory_new ("tcpsink",GST_TYPE_TCPSINK, - &gst_tcpsink_details); - g_return_val_if_fail (sink != NULL, FALSE); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (sink)); - - src = gst_element_factory_new ("tcpsrc",GST_TYPE_TCPSRC, - &gst_tcpsrc_details); - g_return_val_if_fail (src != NULL, FALSE); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (src)); + if (!gst_element_register (plugin, "tcpsrc", GST_RANK_NONE, GST_TYPE_TCPSRC)) + return FALSE; return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "tcp", - plugin_init -}; + "transfer data over the network via TCP", + plugin_init, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) diff --git a/gst/tcp/gsttcpplugin.c b/gst/tcp/gsttcpplugin.c index 1b7f57aeed..60e7d7943b 100644 --- a/gst/tcp/gsttcpplugin.c +++ b/gst/tcp/gsttcpplugin.c @@ -21,32 +21,27 @@ #include "gsttcpsrc.h" #include "gsttcpsink.h" -/* elementfactory information */ -extern GstElementDetails gst_tcpsrc_details; -extern GstElementDetails gst_tcpsink_details; - static gboolean -plugin_init (GModule *module, GstPlugin *plugin) +plugin_init (GstPlugin *plugin) { - GstElementFactory *src, *sink; + if (!gst_element_register (plugin, "tcpsink", GST_RANK_NONE, GST_TYPE_TCPSINK)) + return FALSE; - /* create an elementfactory for the tcpsrc element */ - sink = gst_element_factory_new ("tcpsink",GST_TYPE_TCPSINK, - &gst_tcpsink_details); - g_return_val_if_fail (sink != NULL, FALSE); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (sink)); - - src = gst_element_factory_new ("tcpsrc",GST_TYPE_TCPSRC, - &gst_tcpsrc_details); - g_return_val_if_fail (src != NULL, FALSE); - gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (src)); + if (!gst_element_register (plugin, "tcpsrc", GST_RANK_NONE, GST_TYPE_TCPSRC)) + return FALSE; return TRUE; } -GstPluginDesc plugin_desc = { +GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR, GST_VERSION_MINOR, "tcp", - plugin_init -}; + "transfer data over the network via TCP", + plugin_init, + VERSION, + GST_LICENSE, + GST_COPYRIGHT, + GST_PACKAGE, + GST_ORIGIN +) diff --git a/gst/tcp/gsttcpsink.c b/gst/tcp/gsttcpsink.c index 01b4db0e56..869653f605 100644 --- a/gst/tcp/gsttcpsink.c +++ b/gst/tcp/gsttcpsink.c @@ -26,15 +26,12 @@ #define TCP_DEFAULT_PORT 4953 /* elementfactory information */ -GstElementDetails gst_tcpsink_details = { +static GstElementDetails gst_tcpsink_details = GST_ELEMENT_DETAILS ( "TCP packet sender", - "Sink/Network", "LGPL", "Send data over the network via TCP", - VERSION, - "Zeeshan Ali ", - "(C) 2003", -}; + "Zeeshan Ali " +); /* TCPSink signals and args */ enum { @@ -67,6 +64,7 @@ gst_tcpsink_control_get_type(void) { return tcpsink_control_type; } +static void gst_tcpsink_base_init (gpointer g_class); static void gst_tcpsink_class_init (GstTCPSink *klass); static void gst_tcpsink_init (GstTCPSink *tcpsink); @@ -93,7 +91,7 @@ gst_tcpsink_get_type (void) if (!tcpsink_type) { static const GTypeInfo tcpsink_info = { sizeof(GstTCPSinkClass), - NULL, + gst_tcpsink_base_init, NULL, (GClassInitFunc)gst_tcpsink_class_init, NULL, @@ -108,6 +106,14 @@ gst_tcpsink_get_type (void) return tcpsink_type; } +static void +gst_tcpsink_base_init (gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &gst_tcpsink_details); +} + static void gst_tcpsink_class_init (GstTCPSink *klass) { diff --git a/gst/tcp/gsttcpsrc.c b/gst/tcp/gsttcpsrc.c index 205edd809a..fb17fe3709 100644 --- a/gst/tcp/gsttcpsrc.c +++ b/gst/tcp/gsttcpsrc.c @@ -28,15 +28,12 @@ #define TCP_DEFAULT_PORT 4953 /* elementfactory information */ -GstElementDetails gst_tcpsrc_details = { +GstElementDetails gst_tcpsrc_details = GST_ELEMENT_DETAILS ( "TCP packet receiver", "Source/Network", - "LGPL", "Receive data over the network via TCP", - VERSION, - "Zeeshan Ali ", - "(C) 2003", -}; + "Zeeshan Ali " +); /* TCPSrc signals and args */ enum { @@ -67,6 +64,7 @@ gst_tcpsrc_control_get_type(void) { return tcpsrc_control_type; } +static void gst_tcpsrc_base_init (gpointer g_class); static void gst_tcpsrc_class_init (GstTCPSrc *klass); static void gst_tcpsrc_init (GstTCPSrc *tcpsrc); @@ -92,7 +90,7 @@ gst_tcpsrc_get_type (void) if (!tcpsrc_type) { static const GTypeInfo tcpsrc_info = { sizeof(GstTCPSrcClass), - NULL, + gst_tcpsrc_base_init, NULL, (GClassInitFunc)gst_tcpsrc_class_init, NULL, @@ -107,6 +105,14 @@ gst_tcpsrc_get_type (void) return tcpsrc_type; } +static void +gst_tcpsrc_base_init (gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + + gst_element_class_set_details (element_class, &gst_tcpsrc_details); +} + static void gst_tcpsrc_class_init (GstTCPSrc *klass) {