Passthrough... New plugin system... Bla...

Original commit message from CVS:
Passthrough... New plugin system... Bla...
This commit is contained in:
Ronald S. Bultje 2003-11-02 21:37:09 +00:00
parent c19bddc886
commit ac6d8c026f

View file

@ -33,12 +33,9 @@
static GstElementDetails passthrough_details = { static GstElementDetails passthrough_details = {
"Passthrough", "Passthrough",
"Filter/Audio/Effect", "Filter/Audio/Effect",
"LGPL",
"Transparent filter for audio/raw (boilerplate for effects)", "Transparent filter for audio/raw (boilerplate for effects)",
VERSION,
"Thomas <thomas@apestaart.org>, "\ "Thomas <thomas@apestaart.org>, "\
"Andy Wingo <apwingo@eos.ncsu.edu>", "Andy Wingo <apwingo@eos.ncsu.edu>"
"(C) 2001",
}; };
enum { enum {
@ -88,6 +85,7 @@ passthrough_src_factory (void)
} }
static void passthrough_class_init (GstPassthroughClass *klass); static void passthrough_class_init (GstPassthroughClass *klass);
static void passthrough_base_init (GstPassthroughClass *klass);
static void passthrough_init (GstPassthrough *filter); static void passthrough_init (GstPassthrough *filter);
static void passthrough_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void passthrough_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
@ -164,7 +162,8 @@ gst_passthrough_get_type (void)
if (!passthrough_type) { if (!passthrough_type) {
static const GTypeInfo passthrough_info = { static const GTypeInfo passthrough_info = {
sizeof (GstPassthroughClass), NULL, sizeof (GstPassthroughClass),
(GBaseInitFunc) passthrough_base_init,
NULL, NULL,
(GClassInitFunc) passthrough_class_init, (GClassInitFunc) passthrough_class_init,
NULL, NULL,
@ -178,6 +177,16 @@ gst_passthrough_get_type (void)
return passthrough_type; return passthrough_type;
} }
static void
passthrough_base_init (GstPassthroughClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class, passthrough_src_factory ());
gst_element_class_add_pad_template (element_class, passthrough_sink_factory ());
gst_element_class_set_details (element_class, &passthrough_details);
}
static void static void
passthrough_class_init (GstPassthroughClass *klass) passthrough_class_init (GstPassthroughClass *klass)
{ {
@ -307,24 +316,21 @@ passthrough_get_property (GObject *object, guint prop_id, GValue *value, GParamS
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory; return gst_element_register (plugin, "passthrough",
GST_RANK_NONE, GST_TYPE_PASSTHROUGH);
factory = gst_element_factory_new ("passthrough", GST_TYPE_PASSTHROUGH, &passthrough_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, passthrough_src_factory ());
gst_element_factory_add_pad_template (factory, passthrough_sink_factory ());
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"passthrough", "passthrough",
plugin_init "Transparent filter for audio/raw (boilerplate for effects)",
}; plugin_init,
VERSION,
"LGPL",
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)