and even sine sources can be generated again

Original commit message from CVS:
and even sine sources can be generated again
This commit is contained in:
Ronald S. Bultje 2003-11-02 22:20:19 +00:00
parent 71e2ed4a1c
commit e5f82e4cb9

View File

@ -35,11 +35,8 @@
GstElementDetails gst_sinesrc_details = { GstElementDetails gst_sinesrc_details = {
"Sine-wave src", "Sine-wave src",
"Source/Audio", "Source/Audio",
"LGPL",
"Create a sine wave of a given frequency and volume", "Create a sine wave of a given frequency and volume",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>",
"(C) 1999",
}; };
@ -76,6 +73,7 @@ GST_PAD_TEMPLATE_FACTORY (sinesrc_src_factory,
); );
static void gst_sinesrc_class_init (GstSineSrcClass *klass); static void gst_sinesrc_class_init (GstSineSrcClass *klass);
static void gst_sinesrc_base_init (GstSineSrcClass *klass);
static void gst_sinesrc_init (GstSineSrc *src); static void gst_sinesrc_init (GstSineSrc *src);
static void gst_sinesrc_set_property (GObject *object, static void gst_sinesrc_set_property (GObject *object,
guint prop_id, guint prop_id,
@ -108,7 +106,8 @@ gst_sinesrc_get_type (void)
if (!sinesrc_type) { if (!sinesrc_type) {
static const GTypeInfo sinesrc_info = { static const GTypeInfo sinesrc_info = {
sizeof (GstSineSrcClass), NULL, NULL, sizeof (GstSineSrcClass),
(GBaseInitFunc) gst_sinesrc_base_init, NULL,
(GClassInitFunc) gst_sinesrc_class_init, NULL, NULL, (GClassInitFunc) gst_sinesrc_class_init, NULL, NULL,
sizeof (GstSineSrc), 0, sizeof (GstSineSrc), 0,
(GInstanceInitFunc) gst_sinesrc_init, (GInstanceInitFunc) gst_sinesrc_init,
@ -119,6 +118,16 @@ gst_sinesrc_get_type (void)
return sinesrc_type; return sinesrc_type;
} }
static void
gst_sinesrc_base_init (GstSineSrcClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (sinesrc_src_factory));
gst_element_class_set_details (element_class, &gst_sinesrc_details);
}
static void static void
gst_sinesrc_class_init (GstSineSrcClass *klass) gst_sinesrc_class_init (GstSineSrcClass *klass)
{ {
@ -441,28 +450,24 @@ gst_sinesrc_force_caps (GstSineSrc *src) {
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory;
factory = gst_element_factory_new ("sinesrc", GST_TYPE_SINESRC,
&gst_sinesrc_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_element_factory_add_pad_template (factory,
GST_PAD_TEMPLATE_GET (sinesrc_src_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
/* initialize dparam support library */ /* initialize dparam support library */
gst_control_init(NULL,NULL); gst_control_init(NULL,NULL);
return TRUE; return gst_element_register (plugin, "sinesrc",
GST_RANK_NONE, GST_TYPE_SINESRC);
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"sinesrc", "sine",
plugin_init "Sine audio wave generator",
}; plugin_init,
VERSION,
"LGPL",
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)