Updated for the new plugin loading code

Original commit message from CVS:
Updated for the new plugin loading code
This commit is contained in:
Jan Schmidt 2003-11-02 12:48:08 +00:00
parent c4ec05bbd7
commit 9e42080f8d
10 changed files with 164 additions and 108 deletions

View file

@ -25,6 +25,7 @@
#include "config.h"
#endif
#include <string.h>
#include "gsteffectv.h"
#define GST_TYPE_AGINGTV \
@ -78,15 +79,12 @@ struct _GstAgingTVClass
};
/* elementfactory information */
GstElementDetails gst_agingtv_details = {
static GstElementDetails gst_agingtv_details = GST_ELEMENT_DETAILS (
"AgingTV",
"Filter/Video/Effect",
"LGPL",
"Aply aging effect on video",
VERSION,
"Wim Taymans <wim.taymans@chello.be>",
"(C) 2001 FUKUCHI Kentarou",
};
"Apply aging effect on video",
"Wim Taymans <wim.taymans@chello.be>"
);
/* Filter signals and args */
@ -101,6 +99,7 @@ enum
ARG_0,
};
static void gst_agingtv_base_init (gpointer g_class);
static void gst_agingtv_class_init (GstAgingTVClass * klass);
static void gst_agingtv_init (GstAgingTV * filter);
@ -122,7 +121,8 @@ GType gst_agingtv_get_type (void)
if (!agingtv_type) {
static const GTypeInfo agingtv_info = {
sizeof (GstAgingTVClass), NULL,
sizeof (GstAgingTVClass),
gst_agingtv_base_init,
NULL,
(GClassInitFunc) gst_agingtv_class_init,
NULL,
@ -137,6 +137,17 @@ GType gst_agingtv_get_type (void)
return agingtv_type;
}
static void
gst_agingtv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_agingtv_details);
}
static void
gst_agingtv_class_init (GstAgingTVClass * klass)
{

View file

@ -66,15 +66,12 @@ struct _GstDiceTVClass
};
/* elementfactory information */
GstElementDetails gst_dicetv_details = {
static GstElementDetails gst_dicetv_details = GST_ELEMENT_DETAILS (
"DiceTV",
"Filter/Video/Effect",
"LGPL",
"'Dices' the screen up into many small squares",
VERSION,
"Wim Taymans <wim.taymans@chello.be>",
"(c) 2001 Sam Mertens",
};
"Wim Taymans <wim.taymans@chello.be>"
);
/* Filter signals and args */
@ -91,6 +88,7 @@ enum
ARG_CUBE_BITS,
};
static void gst_dicetv_base_init (gpointer g_class);
static void gst_dicetv_class_init (GstDiceTVClass * klass);
static void gst_dicetv_init (GstDiceTV * filter);
@ -113,7 +111,8 @@ GType gst_dicetv_get_type (void)
if (!dicetv_type) {
static const GTypeInfo dicetv_info = {
sizeof (GstDiceTVClass), NULL,
sizeof (GstDiceTVClass),
gst_dicetv_base_init,
NULL,
(GClassInitFunc) gst_dicetv_class_init,
NULL,
@ -128,6 +127,17 @@ GType gst_dicetv_get_type (void)
return dicetv_type;
}
static void
gst_dicetv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_dicetv_details);
}
static void
gst_dicetv_class_init (GstDiceTVClass * klass)
{

View file

@ -60,15 +60,12 @@ struct _GstEdgeTVClass
};
/* elementfactory information */
GstElementDetails gst_edgetv_details = {
static GstElementDetails gst_edgetv_details = GST_ELEMENT_DETAILS (
"EdgeTV",
"Filter/Video/Effect",
"LGPL",
"Aply edge detect on video",
VERSION,
"Wim Taymans <wim.taymans@chello.be>",
"(C) 2001 FUKUCHI Kentarou",
};
"Apply edge detect on video",
"Wim Taymans <wim.taymans@chello.be>"
);
/* Filter signals and args */
@ -83,6 +80,7 @@ enum
ARG_0,
};
static void gst_edgetv_base_init (gpointer g_class);
static void gst_edgetv_class_init (GstEdgeTVClass * klass);
static void gst_edgetv_init (GstEdgeTV * filter);
@ -102,7 +100,8 @@ GType gst_edgetv_get_type (void)
if (!edgetv_type) {
static const GTypeInfo edgetv_info = {
sizeof (GstEdgeTVClass), NULL,
sizeof (GstEdgeTVClass),
gst_edgetv_base_init,
NULL,
(GClassInitFunc) gst_edgetv_class_init,
NULL,
@ -117,6 +116,17 @@ GType gst_edgetv_get_type (void)
return edgetv_type;
}
static void
gst_edgetv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_edgetv_details);
}
static void
gst_edgetv_class_init (GstEdgeTVClass * klass)
{

View file

@ -21,6 +21,10 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <gst/gst.h>
#include <gst/video/video.h>
@ -30,19 +34,17 @@
struct _elements_entry {
gchar *name;
GType (*type) (void);
GstElementDetails *details;
gboolean (*factoryinit) (GstElementFactory *factory);
};
static struct _elements_entry _elements[] = {
{ "edgeTV", gst_edgetv_get_type, &gst_edgetv_details, NULL },
{ "agingTV", gst_agingtv_get_type, &gst_agingtv_details, NULL },
{ "diceTV", gst_dicetv_get_type, &gst_dicetv_details, NULL },
{ "warpTV", gst_warptv_get_type, &gst_warptv_details, NULL },
{ "shagadelicTV", gst_shagadelictv_get_type, &gst_shagadelictv_details, NULL },
{ "vertigoTV", gst_vertigotv_get_type, &gst_vertigotv_details, NULL },
{ "revTV", gst_revtv_get_type, &gst_revtv_details, NULL },
{ "quarkTV", gst_quarktv_get_type, &gst_quarktv_details, NULL },
{ "edgeTV", gst_edgetv_get_type },
{ "agingTV", gst_agingtv_get_type },
{ "diceTV", gst_dicetv_get_type },
{ "warpTV", gst_warptv_get_type },
{ "shagadelicTV", gst_shagadelictv_get_type },
{ "vertigoTV", gst_vertigotv_get_type },
{ "revTV", gst_revtv_get_type },
{ "quarkTV", gst_quarktv_get_type },
{ NULL, 0 },
};
@ -86,37 +88,29 @@ gst_effectv_sink_factory (void)
}
static gboolean
plugin_init (GModule * module, GstPlugin * plugin)
plugin_init (GstPlugin * plugin)
{
GstElementFactory *factory;
gint i = 0;
while (_elements[i].name) {
factory = gst_element_factory_new (_elements[i].name,
(_elements[i].type) (),
_elements[i].details);
if (!factory) {
g_warning ("gst_effecttv_new failed for `%s'",
_elements[i].name);
continue;
}
gst_element_factory_add_pad_template (factory, gst_effectv_src_factory ());
gst_element_factory_add_pad_template (factory, gst_effectv_sink_factory ());
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
if (_elements[i].factoryinit) {
_elements[i].factoryinit (factory);
}
if (!gst_element_register (plugin, _elements[i].name,
GST_RANK_NONE, (_elements[i].type) ()))
return FALSE;
i++;
}
return TRUE;
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"effectv",
plugin_init
};
"effect plugins from the effectv project",
plugin_init,
VERSION,
"LGPL",
"Wim Taymans <wim.taymans@chello.be>, (c) 2001 FUKUCHI Kentarou, (c) 2001 Sam Mertens, (c) 2002 Ed Tannenbaum",
GST_PACKAGE,
GST_ORIGIN
);

View file

@ -24,28 +24,13 @@
#include <gst/gst.h>
GType gst_edgetv_get_type (void);
extern GstElementDetails gst_edgetv_details;
GType gst_agingtv_get_type (void);
extern GstElementDetails gst_agingtv_details;
GType gst_dicetv_get_type (void);
extern GstElementDetails gst_dicetv_details;
GType gst_warptv_get_type (void);
extern GstElementDetails gst_warptv_details;
GType gst_shagadelictv_get_type (void);
extern GstElementDetails gst_shagadelictv_details;
GType gst_vertigotv_get_type (void);
extern GstElementDetails gst_vertigotv_details;
GType gst_revtv_get_type (void);
extern GstElementDetails gst_revtv_details;
GType gst_quarktv_get_type (void);
extern GstElementDetails gst_quarktv_details;
extern GstPadTemplate *gst_effectv_sink_factory ();
extern GstPadTemplate *gst_effectv_src_factory ();

View file

@ -66,16 +66,12 @@ struct _GstQuarkTVClass
};
/* elementfactory information */
GstElementDetails gst_quarktv_details = {
static GstElementDetails gst_quarktv_details = GST_ELEMENT_DETAILS (
"QuarkTV",
"Filter/Video/Effect",
"LGPL",
"Motion disolver",
VERSION,
"FUKUCHI, Kentarou <fukuchi@users.sourceforge.net>",
"(C) 2001 FUKUCHI Kentarou",
};
"Motion dissolver",
"FUKUCHI, Kentarou <fukuchi@users.sourceforge.net>"
);
/* Filter signals and args */
enum
@ -90,6 +86,7 @@ enum
ARG_PLANES,
};
static void gst_quarktv_base_init (gpointer g_class);
static void gst_quarktv_class_init (GstQuarkTVClass * klass);
static void gst_quarktv_init (GstQuarkTV * filter);
@ -121,7 +118,7 @@ GType gst_quarktv_get_type (void)
if (!quarktv_type) {
static const GTypeInfo quarktv_info = {
sizeof (GstQuarkTVClass),
NULL,
gst_quarktv_base_init,
NULL,
(GClassInitFunc) gst_quarktv_class_init,
NULL,
@ -136,6 +133,17 @@ GType gst_quarktv_get_type (void)
return quarktv_type;
}
static void
gst_quarktv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_quarktv_details);
}
static void
gst_quarktv_class_init (GstQuarkTVClass * klass)
{

View file

@ -85,16 +85,12 @@ struct _GstRevTVClass
};
/* elementfactory information */
GstElementDetails gst_revtv_details = {
static GstElementDetails gst_revtv_details = GST_ELEMENT_DETAILS (
"RevTV",
"Filter/Video/Effect",
"LGPL",
"A video waveform monitor for each line of video processed",
VERSION,
"Wim Taymans <wim.taymans@chello.be>",
"(C) 2001 FUKUCHI Kentarou,"
"(c) 2002 Ed Tannenbaum",
};
"Wim Taymans <wim.taymans@chello.be>"
);
/* Filter signals and args */
@ -112,6 +108,7 @@ enum
ARG_GAIN,
};
static void gst_revtv_base_init (gpointer g_class);
static void gst_revtv_class_init (GstRevTVClass * klass);
static void gst_revtv_init (GstRevTV * filter);
@ -131,7 +128,8 @@ GType gst_revtv_get_type (void)
if (!revtv_type) {
static const GTypeInfo revtv_info = {
sizeof (GstRevTVClass), NULL,
sizeof (GstRevTVClass),
gst_revtv_base_init,
NULL,
(GClassInitFunc) gst_revtv_class_init,
NULL,
@ -146,6 +144,17 @@ GType gst_revtv_get_type (void)
return revtv_type;
}
static void
gst_revtv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_revtv_details);
}
static void
gst_revtv_class_init (GstRevTVClass * klass)
{

View file

@ -67,15 +67,12 @@ struct _GstShagadelicTVClass
};
/* elementfactory information */
GstElementDetails gst_shagadelictv_details = {
static GstElementDetails gst_shagadelictv_details = GST_ELEMENT_DETAILS (
"ShagadelicTV",
"Filter/Video/Effect",
"LGPL",
"Oh behave, ShagedelicTV makes images shagadelic!",
VERSION,
"Wim Taymans <wim.taymans@chello.be>",
"(C) 2001 FUKUCHI Kentarou",
};
"Wim Taymans <wim.taymans@chello.be>"
);
/* Filter signals and args */
@ -90,6 +87,7 @@ enum
ARG_0,
};
static void gst_shagadelictv_base_init (gpointer g_class);
static void gst_shagadelictv_class_init (GstShagadelicTVClass * klass);
static void gst_shagadelictv_init (GstShagadelicTV * filter);
@ -111,7 +109,8 @@ GType gst_shagadelictv_get_type (void)
if (!shagadelictv_type) {
static const GTypeInfo shagadelictv_info = {
sizeof (GstShagadelicTVClass), NULL,
sizeof (GstShagadelicTVClass),
gst_shagadelictv_base_init,
NULL,
(GClassInitFunc) gst_shagadelictv_class_init,
NULL,
@ -126,6 +125,17 @@ GType gst_shagadelictv_get_type (void)
return shagadelictv_type;
}
static void
gst_shagadelictv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_shagadelictv_details);
}
static void
gst_shagadelictv_class_init (GstShagadelicTVClass * klass)
{

View file

@ -69,15 +69,12 @@ struct _GstVertigoTVClass
};
/* elementfactory information */
GstElementDetails gst_vertigotv_details = {
static GstElementDetails gst_vertigotv_details = GST_ELEMENT_DETAILS (
"VertigoTV",
"Filter/Video/Effect",
"LGPL",
"A loopback alpha blending effector with rotating and scaling",
VERSION,
"Wim Taymans <wim.taymans@chello.be>",
"(C) 2001 FUKUCHI Kentarou",
};
"Wim Taymans <wim.taymans@chello.be>"
);
/* Filter signals and args */
@ -95,6 +92,7 @@ enum
ARG_ZOOM_SPEED,
};
static void gst_vertigotv_base_init (gpointer g_class);
static void gst_vertigotv_class_init (GstVertigoTVClass * klass);
static void gst_vertigotv_init (GstVertigoTV * filter);
@ -116,7 +114,8 @@ GType gst_vertigotv_get_type (void)
if (!vertigotv_type) {
static const GTypeInfo vertigotv_info = {
sizeof (GstVertigoTVClass), NULL,
sizeof (GstVertigoTVClass),
gst_vertigotv_base_init,
NULL,
(GClassInitFunc) gst_vertigotv_class_init,
NULL,
@ -131,6 +130,17 @@ GType gst_vertigotv_get_type (void)
return vertigotv_type;
}
static void
gst_vertigotv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_vertigotv_details);
}
static void
gst_vertigotv_class_init (GstVertigoTVClass * klass)
{

View file

@ -73,16 +73,12 @@ struct _GstWarpTVClass
};
/* elementfactory information */
GstElementDetails gst_warptv_details = {
static GstElementDetails gst_warptv_details = GST_ELEMENT_DETAILS (
"WarpTV",
"Filter/Video/Effect",
"LGPL",
"WarpTV does realtime goo'ing of the video input",
VERSION,
"Sam Lantinga <slouken@devolution.com>",
"Wim Taymans <wim.taymans@chello.be>, "
"(C) 2001 FUKUCHI Kentarou",
};
"Sam Lantinga <slouken@devolution.com>"
);
/* Filter signals and args */
@ -97,6 +93,7 @@ enum
ARG_0,
};
static void gst_warptv_base_init (gpointer g_class);
static void gst_warptv_class_init (GstWarpTVClass * klass);
static void gst_warptv_init (GstWarpTV * filter);
@ -118,7 +115,8 @@ GType gst_warptv_get_type (void)
if (!warptv_type) {
static const GTypeInfo warptv_info = {
sizeof (GstWarpTVClass), NULL,
sizeof (GstWarpTVClass),
gst_warptv_base_init,
NULL,
(GClassInitFunc) gst_warptv_class_init,
NULL,
@ -133,6 +131,17 @@ GType gst_warptv_get_type (void)
return warptv_type;
}
static void
gst_warptv_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_effectv_src_factory ());
gst_element_class_add_pad_template (element_class, gst_effectv_sink_factory ());
gst_element_class_set_details (element_class, &gst_warptv_details);
}
static void
gst_warptv_class_init (GstWarpTVClass * klass)
{