diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-11-02 18:13:24 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2003-11-02 18:13:24 +0000 |
commit | 3abd39932a5523ef0132df60e8d22d42bf055889 (patch) | |
tree | 254b8815739fa8fab2e6c5a357b313730f7aea97 /gst/law/alaw.c | |
parent | 6c3a7baa8d7a2db02ebe978bc508f18b938621b3 (diff) |
......
Original commit message from CVS:
......
Diffstat (limited to 'gst/law/alaw.c')
-rw-r--r-- | gst/law/alaw.c | 57 |
1 files changed, 15 insertions, 42 deletions
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 +) |