static GstElementDetails cutter_details = {
"Cutter",
"Filter/Audio/Effect",
- "LGPL",
"Audio Cutter to split audio into non-silent bits",
- VERSION,
"Thomas <thomas@apestaart.org>",
- "(C) 2001",
};
)
);
+static void gst_cutter_base_init (gpointer g_class);
static void gst_cutter_class_init (GstCutterClass *klass);
static void gst_cutter_init (GstCutter *filter);
if (!cutter_type) {
static const GTypeInfo cutter_info = {
- sizeof (GstCutterClass), NULL, NULL,
+ sizeof (GstCutterClass),
+ gst_cutter_base_init,
+ NULL,
(GClassInitFunc) gst_cutter_class_init, NULL, NULL,
sizeof (GstCutter), 0,
(GInstanceInitFunc) gst_cutter_init,
return cutter_type;
}
+static void
+gst_cutter_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (cutter_src_factory));
+ gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (cutter_sink_factory));
+ gst_element_class_set_details (element_class, &cutter_details);
+}
+
static GstPadLinkReturn
gst_cutter_link (GstPad *pad, GstCaps *caps)
{
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
- factory = gst_element_factory_new ("cutter", GST_TYPE_CUTTER,
- &cutter_details);
- g_return_val_if_fail(factory != NULL, FALSE);
-
- gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (cutter_src_factory));
- gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (cutter_sink_factory));
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- /* load audio support library */
+ /* load audio support library */
if (!gst_library_load ("gstaudio"))
return FALSE;
+ if (!gst_element_register (plugin, "cutter", GST_RANK_NONE, GST_TYPE_CUTTER))
+ return FALSE;
+
return TRUE;
}
-GstPluginDesc plugin_desc =
-{
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"cutter",
- plugin_init
-};
+ "Audio Cutter to split audio into non-silent bits",
+ plugin_init,
+ VERSION,
+ "LGPL",
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN)
void
gst_cutter_get_caps (GstPad *pad, GstCutter* filter)
static GstElementDetails plugin_details = {
"Electric Fence",
"Testing/EFence",
- "LGPL",
"This element converts a stream of normal GStreamer buffers into a "
"stream of buffers that are allocated in such a way that out-of-bounds "
"access to data in the buffer is more likely to cause segmentation "
"faults. This allocation method is very similar to the debugging tool "
"\"Electric Fence\".",
- VERSION,
"David A. Schleef <ds@schleef.org>",
- "(C) 2002, 2003"
};
/* Filter signals and args */
GST_CAPS_ANY
);
+static void gst_efence_base_init (gpointer g_class);
static void gst_efence_class_init (GstEFenceClass *klass);
static void gst_efence_init (GstEFence *filter);
static const GTypeInfo plugin_info =
{
sizeof (GstEFenceClass),
- NULL,
+ gst_efence_base_init,
NULL,
(GClassInitFunc) gst_efence_class_init,
NULL,
return plugin_type;
}
+static void
+gst_efence_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_add_pad_template (element_class, gst_efence_sink_factory ());
+ gst_element_class_add_pad_template (element_class, gst_efence_src_factory ());
+ gst_element_class_set_details (element_class, &plugin_details);
+}
+
/* initialize the plugin's class */
static void
gst_efence_class_init (GstEFenceClass *klass)
* register the features
*/
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
- factory = gst_element_factory_new ("efence", GST_TYPE_EFENCE,
- &plugin_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- gst_element_factory_add_pad_template (factory,
- gst_efence_src_factory ());
- gst_element_factory_add_pad_template (factory,
- gst_efence_sink_factory ());
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
+ if (!gst_element_register (plugin, "efence", GST_RANK_NONE, GST_TYPE_EFENCE))
+ return FALSE;
+
/* plugin initialisation succeeded */
return TRUE;
}
-/* this is the structure that gst-register looks for
- * so keep the name plugin_desc, or you cannot get your plug-in registered */
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"efence",
- plugin_init
-};
-
-
-
+ "This element converts a stream of normal GStreamer buffers into a "
+ "stream of buffers that are allocated in such a way that out-of-bounds "
+ "access to data in the buffer is more likely to cause segmentation "
+ "faults. This allocation method is very similar to the debugging tool "
+ "\"Electric Fence\".",
+ plugin_init,
+ VERSION,
+ "LGPL",
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN)
GstBuffer *gst_fenced_buffer_new(void)
{