mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
fix for new plugin system
Original commit message from CVS: fix for new plugin system
This commit is contained in:
parent
1075f2109f
commit
309bd248b1
4 changed files with 65 additions and 57 deletions
|
@ -25,15 +25,12 @@
|
|||
#include "gstspectrum.h"
|
||||
|
||||
/* elementfactory information */
|
||||
static GstElementDetails gst_spectrum_details = {
|
||||
static GstElementDetails gst_spectrum_details = GST_ELEMENT_DETAILS (
|
||||
"Spectrum analyzer",
|
||||
"Filter/Audio/Analysis",
|
||||
"LGPL",
|
||||
"Run an FFT on the audio signal, output spectrum data",
|
||||
VERSION,
|
||||
"Erik Walthinsen <omega@cse.ogi.edu>",
|
||||
"(C) 1999",
|
||||
};
|
||||
"Erik Walthinsen <omega@cse.ogi.edu>"
|
||||
);
|
||||
|
||||
/* Spectrum signals and args */
|
||||
enum {
|
||||
|
@ -47,6 +44,7 @@ enum {
|
|||
};
|
||||
|
||||
|
||||
static void gst_spectrum_base_init (gpointer g_class);
|
||||
static void gst_spectrum_class_init (GstSpectrumClass *klass);
|
||||
static void gst_spectrum_init (GstSpectrum *spectrum);
|
||||
|
||||
|
@ -70,7 +68,8 @@ gst_spectrum_get_type (void)
|
|||
|
||||
if (!spectrum_type) {
|
||||
static const GTypeInfo spectrum_info = {
|
||||
sizeof(GstSpectrumClass), NULL,
|
||||
sizeof(GstSpectrumClass),
|
||||
gst_spectrum_base_init,
|
||||
NULL,
|
||||
(GClassInitFunc)gst_spectrum_class_init,
|
||||
NULL,
|
||||
|
@ -84,6 +83,13 @@ gst_spectrum_get_type (void)
|
|||
return spectrum_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_spectrum_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details (element_class, &gst_spectrum_details);
|
||||
}
|
||||
static void
|
||||
gst_spectrum_class_init (GstSpectrumClass *klass)
|
||||
{
|
||||
|
@ -193,23 +199,20 @@ gst_spectrum_chain (GstPad *pad, GstData *_data)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
plugin_init (GModule *module, GstPlugin *plugin)
|
||||
plugin_init (GstPlugin *plugin)
|
||||
{
|
||||
GstElementFactory *factory;
|
||||
|
||||
/* create an elementfactory for the spectrum element */
|
||||
factory = gst_element_factory_new ("spectrum",GST_TYPE_SPECTRUM,
|
||||
&gst_spectrum_details);
|
||||
g_return_val_if_fail (factory != NULL, FALSE);
|
||||
|
||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
|
||||
|
||||
return TRUE;
|
||||
return gst_element_register (plugin, "spectrum", GST_RANK_NONE, GST_TYPE_SPECTRUM);
|
||||
}
|
||||
|
||||
GstPluginDesc plugin_desc = {
|
||||
GST_PLUGIN_DEFINE (
|
||||
GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"spectrum",
|
||||
plugin_init
|
||||
};
|
||||
"Run an FFT on the audio signal, output spectrum data",
|
||||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -21,32 +21,27 @@
|
|||
#include "gstudpsrc.h"
|
||||
#include "gstudpsink.h"
|
||||
|
||||
/* elementfactory information */
|
||||
extern GstElementDetails gst_udpsrc_details;
|
||||
extern GstElementDetails gst_udpsink_details;
|
||||
|
||||
static gboolean
|
||||
plugin_init (GModule *module, GstPlugin *plugin)
|
||||
plugin_init (GstPlugin *plugin)
|
||||
{
|
||||
GstElementFactory *src, *sink;
|
||||
if (!gst_element_register (plugin, "udpsink", GST_RANK_NONE, GST_TYPE_UDPSINK))
|
||||
return FALSE;
|
||||
|
||||
/* create an elementfactory for the udpsrc element */
|
||||
sink = gst_element_factory_new ("udpsink",GST_TYPE_UDPSINK,
|
||||
&gst_udpsink_details);
|
||||
g_return_val_if_fail (sink != NULL, FALSE);
|
||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (sink));
|
||||
|
||||
src = gst_element_factory_new ("udpsrc",GST_TYPE_UDPSRC,
|
||||
&gst_udpsrc_details);
|
||||
g_return_val_if_fail (src != NULL, FALSE);
|
||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (src));
|
||||
if (!gst_element_register (plugin, "udpsrc", GST_RANK_NONE, GST_TYPE_UDPSRC))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GstPluginDesc plugin_desc = {
|
||||
GST_PLUGIN_DEFINE (
|
||||
GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"udp",
|
||||
plugin_init
|
||||
};
|
||||
"transfer data via UDP",
|
||||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
GST_COPYRIGHT,
|
||||
GST_PACKAGE,
|
||||
GST_ORIGIN
|
||||
)
|
||||
|
|
|
@ -28,15 +28,12 @@
|
|||
#define UDP_DEFAULT_CONTROL 1
|
||||
|
||||
/* elementfactory information */
|
||||
GstElementDetails gst_udpsink_details = {
|
||||
GstElementDetails gst_udpsink_details = GST_ELEMENT_DETAILS (
|
||||
"UDP packet sender",
|
||||
"Sink/Network",
|
||||
"LGPL",
|
||||
"Send data over the network via UDP",
|
||||
VERSION,
|
||||
"Wim Taymans <wim.taymans@chello.be>",
|
||||
"(C) 2001",
|
||||
};
|
||||
"Wim Taymans <wim.taymans@chello.be>"
|
||||
);
|
||||
|
||||
/* UDPSink signals and args */
|
||||
enum {
|
||||
|
@ -70,6 +67,7 @@ gst_udpsink_control_get_type(void) {
|
|||
return udpsink_control_type;
|
||||
}
|
||||
|
||||
static void gst_udpsink_base_init (gpointer g_class);
|
||||
static void gst_udpsink_class_init (GstUDPSink *klass);
|
||||
static void gst_udpsink_init (GstUDPSink *udpsink);
|
||||
|
||||
|
@ -92,11 +90,10 @@ gst_udpsink_get_type (void)
|
|||
{
|
||||
static GType udpsink_type = 0;
|
||||
|
||||
|
||||
if (!udpsink_type) {
|
||||
static const GTypeInfo udpsink_info = {
|
||||
sizeof(GstUDPSinkClass),
|
||||
NULL,
|
||||
gst_udpsink_base_init,
|
||||
NULL,
|
||||
(GClassInitFunc)gst_udpsink_class_init,
|
||||
NULL,
|
||||
|
@ -111,6 +108,14 @@ gst_udpsink_get_type (void)
|
|||
return udpsink_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_udpsink_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details (element_class, &gst_udpsink_details);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_udpsink_class_init (GstUDPSink *klass)
|
||||
{
|
||||
|
|
|
@ -29,15 +29,12 @@
|
|||
#define UDP_DEFAULT_MULTICAST_GROUP "0.0.0.0"
|
||||
|
||||
/* elementfactory information */
|
||||
GstElementDetails gst_udpsrc_details = {
|
||||
static GstElementDetails gst_udpsrc_details = GST_ELEMENT_DETAILS (
|
||||
"UDP packet receiver",
|
||||
"Source/Network",
|
||||
"LGPL",
|
||||
"Receive data over the network via UDP",
|
||||
VERSION,
|
||||
"Wim Taymans <wim.taymans@chello.be>",
|
||||
"(C) 2001",
|
||||
};
|
||||
"Wim Taymans <wim.taymans@chello.be>"
|
||||
);
|
||||
|
||||
/* UDPSrc signals and args */
|
||||
enum {
|
||||
|
@ -69,6 +66,7 @@ gst_udpsrc_control_get_type(void) {
|
|||
return udpsrc_control_type;
|
||||
}
|
||||
|
||||
static void gst_udpsrc_base_init (gpointer g_class);
|
||||
static void gst_udpsrc_class_init (GstUDPSrc *klass);
|
||||
static void gst_udpsrc_init (GstUDPSrc *udpsrc);
|
||||
|
||||
|
@ -90,11 +88,10 @@ gst_udpsrc_get_type (void)
|
|||
{
|
||||
static GType udpsrc_type = 0;
|
||||
|
||||
|
||||
if (!udpsrc_type) {
|
||||
static const GTypeInfo udpsrc_info = {
|
||||
sizeof(GstUDPSrcClass),
|
||||
NULL,
|
||||
gst_udpsrc_base_init,
|
||||
NULL,
|
||||
(GClassInitFunc)gst_udpsrc_class_init,
|
||||
NULL,
|
||||
|
@ -109,6 +106,14 @@ gst_udpsrc_get_type (void)
|
|||
return udpsrc_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_udpsrc_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details (element_class, &gst_udpsrc_details);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_udpsrc_class_init (GstUDPSrc *klass)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue