summaryrefslogtreecommitdiffstats
path: root/gst/law
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-11-02 18:13:24 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-11-02 18:13:24 +0000
commit3abd39932a5523ef0132df60e8d22d42bf055889 (patch)
tree254b8815739fa8fab2e6c5a357b313730f7aea97 /gst/law
parent6c3a7baa8d7a2db02ebe978bc508f18b938621b3 (diff)
......
Original commit message from CVS: ......
Diffstat (limited to 'gst/law')
-rw-r--r--gst/law/alaw-decode.c21
-rw-r--r--gst/law/alaw-encode.c21
-rw-r--r--gst/law/alaw.c57
-rw-r--r--gst/law/mulaw-decode.c21
-rw-r--r--gst/law/mulaw-encode.c21
-rw-r--r--gst/law/mulaw.c61
6 files changed, 110 insertions, 92 deletions
diff --git a/gst/law/alaw-decode.c b/gst/law/alaw-decode.c
index 2ba0d536..62954763 100644
--- a/gst/law/alaw-decode.c
+++ b/gst/law/alaw-decode.c
@@ -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,
@@ -119,6 +128,16 @@ gst_alawdec_get_type(void) {
}
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)
{
GObjectClass *gobject_class;
diff --git a/gst/law/alaw-encode.c b/gst/law/alaw-encode.c
index 9edd8cb2..cc86537f 100644
--- a/gst/law/alaw-encode.c
+++ b/gst/law/alaw-encode.c
@@ -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,
@@ -158,6 +167,16 @@ gst_alawenc_get_type(void) {
}
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)
{
GObjectClass *gobject_class;
diff --git a/gst/law/alaw.c b/gst/law/alaw.c
index cae6ad5f..a9c2447a 100644
--- a/gst/law/alaw.c
+++ b/gst/law/alaw.c
@@ -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
+)
diff --git a/gst/law/mulaw-decode.c b/gst/law/mulaw-decode.c
index b9db0de8..ce1fd947 100644
--- a/gst/law/mulaw-decode.c
+++ b/gst/law/mulaw-decode.c
@@ -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,
@@ -98,6 +107,16 @@ gst_mulawdec_get_type(void) {
}
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)
{
GObjectClass *gobject_class;
diff --git a/gst/law/mulaw-encode.c b/gst/law/mulaw-encode.c
index 8fa4a613..9dd2e470 100644
--- a/gst/law/mulaw-encode.c
+++ b/gst/law/mulaw-encode.c
@@ -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,
@@ -96,6 +105,16 @@ gst_mulawenc_get_type(void) {
}
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)
{
GObjectClass *gobject_class;
diff --git a/gst/law/mulaw.c b/gst/law/mulaw.c
index edb5c8e0..368bea89 100644
--- a/gst/law/mulaw.c
+++ b/gst/law/mulaw.c
@@ -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
+)