Commit 6d5504f6 authored by Iain Holmes's avatar Iain Holmes

Update all the audiofile stuff

Original commit message from CVS:
Update all the audiofile stuff
parent c9b26381
......@@ -22,25 +22,30 @@
#include "gstafsink.h"
#include "gstafparse.h"
gboolean gst_aftypes_plugin_init (GModule *module, GstPlugin *plugin);
gboolean gst_aftypes_plugin_init (GstPlugin *plugin);
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
plugin_init (GstPlugin *plugin)
{
if (!gst_library_load ("gstbytestream"))
return FALSE;
gst_afsink_plugin_init (module, plugin);
gst_afsrc_plugin_init (module, plugin);
gst_afparse_plugin_init (module, plugin);
gst_aftypes_plugin_init (module, plugin);
gst_afsink_plugin_init (plugin);
gst_afsrc_plugin_init (plugin);
gst_afparse_plugin_init (plugin);
gst_aftypes_plugin_init (plugin);
return TRUE;
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstaf",
plugin_init
};
"Audiofile plugin",
plugin_init,
VERSION,
"LGPL",
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN)
......@@ -33,11 +33,8 @@
static GstElementDetails afparse_details = {
"Audiofile Parse",
"Codec/Parser",
"LGPL",
"Audiofile parser for audio/raw",
VERSION,
"Steve Baker <stevebaker_org@yahoo.co.uk>",
"(C) 2002"
};
......@@ -90,6 +87,7 @@ GST_PAD_TEMPLATE_FACTORY (afparse_sink_factory,
)
)
static void gst_afparse_base_init (gpointer g_class);
static void gst_afparse_class_init(GstAFParseClass *klass);
static void gst_afparse_init (GstAFParse *afparse);
......@@ -113,7 +111,8 @@ gst_afparse_get_type (void)
if (!afparse_type) {
static const GTypeInfo afparse_info = {
sizeof (GstAFParseClass), NULL,
sizeof (GstAFParseClass),
gst_afparse_base_init,
NULL,
(GClassInitFunc) gst_afparse_class_init,
NULL,
......@@ -127,6 +126,17 @@ gst_afparse_get_type (void)
return afparse_type;
}
static void
gst_afparse_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 (afparse_src_factory));
gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (afparse_sink_factory));
gst_element_class_set_details (element_class, &afparse_details);
}
static void
gst_afparse_class_init (GstAFParseClass *klass)
{
......@@ -320,24 +330,15 @@ gst_afparse_get_property (GObject *object, guint prop_id,
}
gboolean
gst_afparse_plugin_init (GModule *module, GstPlugin *plugin)
gst_afparse_plugin_init (GstPlugin *plugin)
{
GstElementFactory *factory;
factory = gst_element_factory_new ("afparse", GST_TYPE_AFPARSE,
&afparse_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (afparse_src_factory));
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (afparse_sink_factory));
/* gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_PRIMARY);*/
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, "afparse", GST_RANK_NONE, GST_TYPE_AFPARSE))
return FALSE;
return TRUE;
}
......
......@@ -95,7 +95,7 @@ struct _GstAFParseClass {
void (*handoff) (GstElement *element,GstPad *pad);
};
gboolean gst_afparse_plugin_init (GModule *module, GstPlugin *plugin);
gboolean gst_afparse_plugin_init (GstPlugin *plugin);
#ifdef __cplusplus
}
......
......@@ -31,11 +31,8 @@
static GstElementDetails afsink_details = {
"Audiofile Sink",
"Sink/Audio",
"LGPL",
"Write audio streams to disk using libaudiofile",
VERSION,
"Thomas <thomas@apestaart.org>",
"(C) 2001"
};
......@@ -98,6 +95,7 @@ gst_afsink_types_get_type (void)
return afsink_types_type;
}
static void gst_afsink_base_init (gpointer g_class);
static void gst_afsink_class_init (GstAFSinkClass *klass);
static void gst_afsink_init (GstAFSink *afsink);
......@@ -125,7 +123,8 @@ gst_afsink_get_type (void)
if (!afsink_type) {
static const GTypeInfo afsink_info = {
sizeof (GstAFSinkClass), NULL,
sizeof (GstAFSinkClass),
gst_afsink_base_init,
NULL,
(GClassInitFunc) gst_afsink_class_init,
NULL,
......@@ -139,6 +138,15 @@ gst_afsink_get_type (void)
return afsink_type;
}
static void
gst_afsink_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 (afsink_sink_factory));
gst_element_class_set_details (element_class, &afsink_details);
}
static void
gst_afsink_class_init (GstAFSinkClass *klass)
{
......@@ -263,17 +271,10 @@ gst_afsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
}
gboolean
gst_afsink_plugin_init (GModule *module, GstPlugin *plugin)
gst_afsink_plugin_init (GstPlugin *plugin)
{
GstElementFactory *factory;
factory = gst_element_factory_new ("afsink", GST_TYPE_AFSINK,
&afsink_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (afsink_sink_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
if (!gst_element_register (plugin, "afsink", GST_RANK_NONE, GST_TYPE_AFSINK))
return FALSE;
return TRUE;
}
......
......@@ -89,7 +89,7 @@ struct _GstAFSinkClass {
};
GType gst_afsink_get_type (void);
gboolean gst_afsink_plugin_init (GModule *module, GstPlugin *plugin);
gboolean gst_afsink_plugin_init (GstPlugin *plugin);
......
......@@ -32,11 +32,8 @@
static GstElementDetails afsrc_details = {
"Audiofile Src",
"Source/Audio",
"LGPL",
"Read audio files from disk using libaudiofile",
VERSION,
"Thomas <thomas@apestaart.org>",
"(C) 2001"
};
......@@ -99,6 +96,7 @@ gst_afsrc_types_get_type (void)
return afsrc_types_type;
}
*/
static void gst_afsrc_base_init (gpointer g_class);
static void gst_afsrc_class_init (GstAFSrcClass *klass);
static void gst_afsrc_init (GstAFSrc *afsrc);
......@@ -124,7 +122,8 @@ gst_afsrc_get_type (void)
if (!afsrc_type) {
static const GTypeInfo afsrc_info = {
sizeof (GstAFSrcClass), NULL,
sizeof (GstAFSrcClass),
gst_afsrc_base_init,
NULL,
(GClassInitFunc) gst_afsrc_class_init,
NULL,
......@@ -138,6 +137,15 @@ gst_afsrc_get_type (void)
return afsrc_type;
}
static void
gst_afsrc_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 (afsrc_src_factory));
gst_element_class_set_details (element_class, &afsrc_details);
}
static void
gst_afsrc_class_init (GstAFSrcClass *klass)
{
......@@ -274,21 +282,14 @@ gst_afsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
}
gboolean
gst_afsrc_plugin_init (GModule *module, GstPlugin *plugin)
gst_afsrc_plugin_init (GstPlugin *plugin)
{
GstElementFactory *factory;
factory = gst_element_factory_new ("afsrc", GST_TYPE_AFSRC,
&afsrc_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (afsrc_src_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
/* load audio support library */
if (!gst_library_load ("gstaudio"))
return FALSE;
if (!gst_element_register (plugin, "afsrc", GST_RANK_NONE, GST_TYPE_AFSRC))
return FALSE;
return TRUE;
}
......
......@@ -95,7 +95,7 @@ struct _GstAFSrcClass {
};
GType gst_afsrc_get_type (void);
gboolean gst_afsrc_plugin_init (GModule *module, GstPlugin *plugin);
gboolean gst_afsrc_plugin_init (GstPlugin *plugin);
......
......@@ -106,13 +106,14 @@ gst_aftypes_type_find(GstTypeFind *tf, gpointer private)
}
gboolean
gst_aftypes_plugin_init (GModule *module, GstPlugin *plugin)
gst_aftypes_plugin_init (GstPlugin *plugin)
{
static gchar * af_exts[] = { "aiff", "aif", "aifc", "wav", "au", "snd", NULL };
gst_type_find_factory_register (plugin, "audio/x-mod",
GST_ELEMENT_RANK_MARGINAL, gst_aftypes_type_find, af_exts,
GST_CAPS_ANY, NULL);
gst_type_find_register (plugin, "audio/x-mod",
GST_RANK_MARGINAL,
gst_aftypes_type_find, af_exts,
GST_CAPS_ANY, NULL);
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment