fix for new plugin system

Original commit message from CVS:
fix for new plugin system
This commit is contained in:
Benjamin Otte 2003-11-02 21:55:15 +00:00
parent 281738cef9
commit 71e2ed4a1c
4 changed files with 54 additions and 52 deletions

View file

@ -21,32 +21,27 @@
#include "gsttcpsrc.h" #include "gsttcpsrc.h"
#include "gsttcpsink.h" #include "gsttcpsink.h"
/* elementfactory information */
extern GstElementDetails gst_tcpsrc_details;
extern GstElementDetails gst_tcpsink_details;
static gboolean 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 */ if (!gst_element_register (plugin, "tcpsrc", GST_RANK_NONE, GST_TYPE_TCPSRC))
sink = gst_element_factory_new ("tcpsink",GST_TYPE_TCPSINK, return FALSE;
&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));
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"tcp", "tcp",
plugin_init "transfer data over the network via TCP",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -21,32 +21,27 @@
#include "gsttcpsrc.h" #include "gsttcpsrc.h"
#include "gsttcpsink.h" #include "gsttcpsink.h"
/* elementfactory information */
extern GstElementDetails gst_tcpsrc_details;
extern GstElementDetails gst_tcpsink_details;
static gboolean 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 */ if (!gst_element_register (plugin, "tcpsrc", GST_RANK_NONE, GST_TYPE_TCPSRC))
sink = gst_element_factory_new ("tcpsink",GST_TYPE_TCPSINK, return FALSE;
&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));
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"tcp", "tcp",
plugin_init "transfer data over the network via TCP",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -26,15 +26,12 @@
#define TCP_DEFAULT_PORT 4953 #define TCP_DEFAULT_PORT 4953
/* elementfactory information */ /* elementfactory information */
GstElementDetails gst_tcpsink_details = { static GstElementDetails gst_tcpsink_details = GST_ELEMENT_DETAILS (
"TCP packet sender", "TCP packet sender",
"Sink/Network",
"LGPL", "LGPL",
"Send data over the network via TCP", "Send data over the network via TCP",
VERSION, "Zeeshan Ali <zak147@yahoo.com>"
"Zeeshan Ali <zak147@yahoo.com>", );
"(C) 2003",
};
/* TCPSink signals and args */ /* TCPSink signals and args */
enum { enum {
@ -67,6 +64,7 @@ gst_tcpsink_control_get_type(void) {
return tcpsink_control_type; 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_class_init (GstTCPSink *klass);
static void gst_tcpsink_init (GstTCPSink *tcpsink); static void gst_tcpsink_init (GstTCPSink *tcpsink);
@ -93,7 +91,7 @@ gst_tcpsink_get_type (void)
if (!tcpsink_type) { if (!tcpsink_type) {
static const GTypeInfo tcpsink_info = { static const GTypeInfo tcpsink_info = {
sizeof(GstTCPSinkClass), sizeof(GstTCPSinkClass),
NULL, gst_tcpsink_base_init,
NULL, NULL,
(GClassInitFunc)gst_tcpsink_class_init, (GClassInitFunc)gst_tcpsink_class_init,
NULL, NULL,
@ -108,6 +106,14 @@ gst_tcpsink_get_type (void)
return tcpsink_type; 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 static void
gst_tcpsink_class_init (GstTCPSink *klass) gst_tcpsink_class_init (GstTCPSink *klass)
{ {

View file

@ -28,15 +28,12 @@
#define TCP_DEFAULT_PORT 4953 #define TCP_DEFAULT_PORT 4953
/* elementfactory information */ /* elementfactory information */
GstElementDetails gst_tcpsrc_details = { GstElementDetails gst_tcpsrc_details = GST_ELEMENT_DETAILS (
"TCP packet receiver", "TCP packet receiver",
"Source/Network", "Source/Network",
"LGPL",
"Receive data over the network via TCP", "Receive data over the network via TCP",
VERSION, "Zeeshan Ali <zak147@yahoo.com>"
"Zeeshan Ali <zak147@yahoo.com>", );
"(C) 2003",
};
/* TCPSrc signals and args */ /* TCPSrc signals and args */
enum { enum {
@ -67,6 +64,7 @@ gst_tcpsrc_control_get_type(void) {
return tcpsrc_control_type; 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_class_init (GstTCPSrc *klass);
static void gst_tcpsrc_init (GstTCPSrc *tcpsrc); static void gst_tcpsrc_init (GstTCPSrc *tcpsrc);
@ -92,7 +90,7 @@ gst_tcpsrc_get_type (void)
if (!tcpsrc_type) { if (!tcpsrc_type) {
static const GTypeInfo tcpsrc_info = { static const GTypeInfo tcpsrc_info = {
sizeof(GstTCPSrcClass), sizeof(GstTCPSrcClass),
NULL, gst_tcpsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_tcpsrc_class_init, (GClassInitFunc)gst_tcpsrc_class_init,
NULL, NULL,
@ -107,6 +105,14 @@ gst_tcpsrc_get_type (void)
return tcpsrc_type; 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 static void
gst_tcpsrc_class_init (GstTCPSrc *klass) gst_tcpsrc_class_init (GstTCPSrc *klass)
{ {