Commit 3abd3993 authored by Ronald S. Bultje's avatar Ronald S. Bultje

......

Original commit message from CVS:
......
parent 6c3a7baa
......@@ -24,6 +24,13 @@
extern GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
/* elementfactory information */
static GstElementDetails alawdec_details = {
"A Law to PCM conversion",
"Codec/Audio/Decoder",
"Convert 8bit A law to 16bit PCM",
"Zaheer Merali <zaheer@bellworldwide.net>"
};
/* Stereo signals and args */
enum {
......@@ -36,6 +43,7 @@ enum {
};
static void gst_alawdec_class_init (GstALawDecClass *klass);
static void gst_alawdec_base_init (GstALawDecClass *klass);
static void gst_alawdec_init (GstALawDec *alawdec);
static void gst_alawdec_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
......@@ -104,7 +112,8 @@ gst_alawdec_get_type(void) {
if (!alawdec_type) {
static const GTypeInfo alawdec_info = {
sizeof(GstALawDecClass), NULL,
sizeof(GstALawDecClass),
(GBaseInitFunc)gst_alawdec_base_init,
NULL,
(GClassInitFunc)gst_alawdec_class_init,
NULL,
......@@ -118,6 +127,16 @@ gst_alawdec_get_type(void) {
return alawdec_type;
}
static void
gst_alawdec_base_init (GstALawDecClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class, alawdec_src_template);
gst_element_class_add_pad_template (element_class, alawdec_sink_template);
gst_element_class_set_details (element_class, &alawdec_details);
}
static void
gst_alawdec_class_init (GstALawDecClass *klass)
{
......
......@@ -24,6 +24,13 @@
extern GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
/* elementfactory information */
static GstElementDetails alawenc_details = {
"PCM to A Law conversion",
"Codec/Audio/Encoder",
"Convert 16bit PCM to 8bit A law",
"Zaheer Merali <zaheer@bellworldwide.net>"
};
/* Stereo signals and args */
enum {
......@@ -36,6 +43,7 @@ enum {
};
static void gst_alawenc_class_init (GstALawEncClass *klass);
static void gst_alawenc_base_init (GstALawEncClass *klass);
static void gst_alawenc_init (GstALawEnc *alawenc);
static void gst_alawenc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
......@@ -143,7 +151,8 @@ gst_alawenc_get_type(void) {
if (!alawenc_type) {
static const GTypeInfo alawenc_info = {
sizeof(GstALawEncClass), NULL,
sizeof(GstALawEncClass),
(GBaseInitFunc)gst_alawenc_base_init,
NULL,
(GClassInitFunc)gst_alawenc_class_init,
NULL,
......@@ -157,6 +166,16 @@ gst_alawenc_get_type(void) {
return alawenc_type;
}
static void
gst_alawenc_base_init (GstALawEncClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class, alawenc_src_template);
gst_element_class_add_pad_template (element_class, alawenc_sink_template);
gst_element_class_set_details (element_class, &alawenc_details);
}
static void
gst_alawenc_class_init (GstALawEncClass *klass)
{
......
......@@ -4,28 +4,6 @@
#include "alaw-encode.h"
#include "alaw-decode.h"
/* elementfactory information */
static GstElementDetails alawenc_details = {
"PCM to A Law conversion",
"Codec/Audio/Encoder",
"LGPL",
"Convert 16bit PCM to 8bit A law",
VERSION,
"Zaheer Merali <zaheer@bellworldwide.net>",
"(C) 2001"
};
/* elementfactory information */
static GstElementDetails alawdec_details = {
"A Law to PCM conversion",
"Codec/Audio/Decoder",
"LGPL",
"Convert 8bit A law to 16bit PCM",
VERSION,
"Zaheer Merali <zaheer@bellworldwide.net>",
"(C) 2001"
};
static GstCaps*
alaw_factory (void)
{
......@@ -60,42 +38,37 @@ GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
plugin_init (GstPlugin *plugin)
{
GstElementFactory *alawenc_factory, *alawdec_factory;
GstCaps* alaw_caps, *linear_caps;
alawenc_factory = gst_element_factory_new("alawenc",GST_TYPE_ALAWENC,
&alawenc_details);
g_return_val_if_fail(alawenc_factory != NULL, FALSE);
alawdec_factory = gst_element_factory_new("alawdec",GST_TYPE_ALAWDEC,
&alawdec_details);
g_return_val_if_fail(alawdec_factory != NULL, FALSE);
gst_element_factory_set_rank (alawdec_factory, GST_ELEMENT_RANK_PRIMARY);
alaw_caps = alaw_factory ();
linear_caps = linear_factory ();
alawenc_src_template = gst_pad_template_new ("src",GST_PAD_SRC,GST_PAD_ALWAYS,alaw_caps, NULL);
alawenc_sink_template = gst_pad_template_new ("sink",GST_PAD_SINK,GST_PAD_ALWAYS,linear_caps, NULL);
gst_element_factory_add_pad_template (alawenc_factory, alawenc_src_template);
gst_element_factory_add_pad_template (alawenc_factory, alawenc_sink_template);
alawdec_src_template = gst_pad_template_new ("src",GST_PAD_SRC,GST_PAD_ALWAYS,linear_caps, NULL);
alawdec_sink_template = gst_pad_template_new ("sink",GST_PAD_SINK,GST_PAD_ALWAYS,alaw_caps, NULL);
gst_element_factory_add_pad_template (alawdec_factory, alawdec_src_template);
gst_element_factory_add_pad_template (alawdec_factory, alawdec_sink_template);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (alawenc_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (alawdec_factory));
if (!gst_element_register (plugin, "alawenc",
GST_RANK_NONE, GST_TYPE_ALAWENC) ||
!gst_element_register (plugin, "alawdec",
GST_RANK_PRIMARY, GST_TYPE_ALAWENC))
return FALSE;
return TRUE;
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"alaw",
plugin_init
};
"ALaw audio conversion routines",
plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
......@@ -23,6 +23,13 @@
extern GstPadTemplate *mulawdec_src_template, *mulawdec_sink_template;
/* elementfactory information */
static GstElementDetails mulawdec_details = {
"Mu Law to PCM conversion",
"Codec/Audio/Decoder",
"Convert 8bit mu law to 16bit PCM",
"Zaheer Merali <zaheer@bellworldwide.net>"
};
/* Stereo signals and args */
enum {
......@@ -35,6 +42,7 @@ enum {
};
static void gst_mulawdec_class_init (GstMuLawDecClass *klass);
static void gst_mulawdec_base_init (GstMuLawDecClass *klass);
static void gst_mulawdec_init (GstMuLawDec *mulawdec);
static void gst_mulawdec_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
......@@ -83,7 +91,8 @@ gst_mulawdec_get_type(void) {
if (!mulawdec_type) {
static const GTypeInfo mulawdec_info = {
sizeof(GstMuLawDecClass), NULL,
sizeof(GstMuLawDecClass),
(GBaseInitFunc)gst_mulawdec_base_init,
NULL,
(GClassInitFunc)gst_mulawdec_class_init,
NULL,
......@@ -97,6 +106,16 @@ gst_mulawdec_get_type(void) {
return mulawdec_type;
}
static void
gst_mulawdec_base_init (GstMuLawDecClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class, mulawdec_src_template);
gst_element_class_add_pad_template (element_class, mulawdec_sink_template);
gst_element_class_set_details (element_class, &mulawdec_details);
}
static void
gst_mulawdec_class_init (GstMuLawDecClass *klass)
{
......
......@@ -23,6 +23,13 @@
extern GstPadTemplate *mulawenc_src_template, *mulawenc_sink_template;
/* elementfactory information */
static GstElementDetails mulawenc_details = {
"PCM to Mu Law conversion",
"Codec/Audio/Encoder",
"Convert 16bit PCM to 8bit mu law",
"Zaheer Merali <zaheer@bellworldwide.net>"
};
/* Stereo signals and args */
enum {
......@@ -35,6 +42,7 @@ enum {
};
static void gst_mulawenc_class_init (GstMuLawEncClass *klass);
static void gst_mulawenc_base_init (GstMuLawEncClass *klass);
static void gst_mulawenc_init (GstMuLawEnc *mulawenc);
static void gst_mulawenc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
......@@ -81,7 +89,8 @@ gst_mulawenc_get_type(void) {
if (!mulawenc_type) {
static const GTypeInfo mulawenc_info = {
sizeof(GstMuLawEncClass), NULL,
sizeof(GstMuLawEncClass),
(GBaseInitFunc)gst_mulawenc_base_init,
NULL,
(GClassInitFunc)gst_mulawenc_class_init,
NULL,
......@@ -95,6 +104,16 @@ gst_mulawenc_get_type(void) {
return mulawenc_type;
}
static void
gst_mulawenc_base_init (GstMuLawEncClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class, mulawenc_src_template);
gst_element_class_add_pad_template (element_class, mulawenc_sink_template);
gst_element_class_set_details (element_class, &mulawenc_details);
}
static void
gst_mulawenc_class_init (GstMuLawEncClass *klass)
{
......
......@@ -4,28 +4,6 @@
#include "mulaw-encode.h"
#include "mulaw-decode.h"
/* elementfactory information */
static GstElementDetails mulawenc_details = {
"PCM to Mu Law conversion",
"Codec/Audio/Encoder",
"LGPL",
"Convert 16bit PCM to 8bit mu law",
VERSION,
"Zaheer Merali <zaheer@bellworldwide.net>",
"(C) 2001"
};
/* elementfactory information */
static GstElementDetails mulawdec_details = {
"Mu Law to PCM conversion",
"Codec/Audio/Decoder",
"LGPL",
"Convert 8bit mu law to 16bit PCM",
VERSION,
"Zaheer Merali <zaheer@bellworldwide.net>",
"(C) 2001"
};
static GstCaps*
mulaw_factory (void)
{
......@@ -63,19 +41,10 @@ GstPadTemplate *mulawenc_src_template, *mulawenc_sink_template;
GstPadTemplate *mulawdec_src_template, *mulawdec_sink_template;
static gboolean
plugin_init (GModule *module, GstPlugin *plugin)
plugin_init (GstPlugin *plugin)
{
GstElementFactory *mulawenc_factory, *mulawdec_factory;
GstCaps* mulaw_caps, *linear_caps;
mulawenc_factory = gst_element_factory_new("mulawenc",GST_TYPE_MULAWENC,
&mulawenc_details);
g_return_val_if_fail(mulawenc_factory != NULL, FALSE);
mulawdec_factory = gst_element_factory_new("mulawdec",GST_TYPE_MULAWDEC,
&mulawdec_details);
g_return_val_if_fail(mulawdec_factory != NULL, FALSE);
gst_element_factory_set_rank (mulawdec_factory, GST_ELEMENT_RANK_PRIMARY);
mulaw_caps = mulaw_factory ();
linear_caps = linear_factory ();
......@@ -84,29 +53,29 @@ plugin_init (GModule *module, GstPlugin *plugin)
mulawenc_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
linear_caps, NULL);
gst_element_factory_add_pad_template (mulawenc_factory, mulawenc_src_template);
gst_element_factory_add_pad_template (mulawenc_factory, mulawenc_sink_template);
mulawdec_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
linear_caps, NULL);
mulawdec_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
mulaw_caps, NULL);
gst_element_factory_add_pad_template (mulawdec_factory, mulawdec_src_template);
gst_element_factory_add_pad_template (mulawdec_factory, mulawdec_sink_template);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (mulawenc_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (mulawdec_factory));
if (!gst_element_register (plugin, "mulawenc",
GST_RANK_NONE, GST_TYPE_MULAWENC) ||
!gst_element_register (plugin, "mulawdec",
GST_RANK_PRIMARY, GST_TYPE_MULAWENC))
return FALSE;
return TRUE;
}
GstPluginDesc plugin_desc = {
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"mulaw",
plugin_init
};
"MuLaw audio conversion routines",
plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
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