1 #include "alaw-encode.h"
2 #include "alaw-decode.h"
4 static GstElementDetails alawenc_details = {
5 "PCM to A Law conversion",
6 "Filter/Audio/Conversion",
7 "Convert 16bit PCM to 8bit A law",
9 "Zaheer Merali <zaheer@bellworldwide.net>",
13 static GstElementDetails alawdec_details = {
14 "A Law to PCM conversion",
15 "Filter/Audio/Conversion",
16 "Convert 8bit A law to 16bit PCM",
18 "Zaheer Merali <zaheer@bellworldwide.net>",
30 "format", GST_PROPS_STRING ("int"),
31 "law", GST_PROPS_INT (2),
32 "width", GST_PROPS_INT(8),
33 "depth", GST_PROPS_INT(8),
34 "signed", GST_PROPS_BOOLEAN(FALSE),
46 "format", GST_PROPS_STRING ("int"),
47 "law", GST_PROPS_INT(0),
48 "width", GST_PROPS_INT(16),
49 "depth", GST_PROPS_INT(16),
50 "signed", GST_PROPS_BOOLEAN(TRUE),
54 GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
55 GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
58 plugin_init (GModule *module, GstPlugin *plugin)
60 GstElementFactory *alawenc_factory, *alawdec_factory;
61 GstCaps* alaw_caps, *linear_caps;
63 alawenc_factory = gst_element_factory_new("alawenc",GST_TYPE_ALAWENC,
65 g_return_val_if_fail(alawenc_factory != NULL, FALSE);
66 alawdec_factory = gst_element_factory_new("alawdec",GST_TYPE_ALAWDEC,
68 g_return_val_if_fail(alawdec_factory != NULL, FALSE);
70 alaw_caps = alaw_factory ();
71 linear_caps = linear_factory ();
73 alawenc_src_template = gst_pad_template_new ("src",GST_PAD_SRC,GST_PAD_ALWAYS,alaw_caps, NULL);
74 alawenc_sink_template = gst_pad_template_new ("sink",GST_PAD_SINK,GST_PAD_ALWAYS,linear_caps, NULL);
75 gst_element_factory_add_pad_template (alawenc_factory, alawenc_src_template);
76 gst_element_factory_add_pad_template (alawenc_factory, alawenc_sink_template);
78 alawdec_src_template = gst_pad_template_new ("src",GST_PAD_SRC,GST_PAD_ALWAYS,linear_caps, NULL);
79 alawdec_sink_template = gst_pad_template_new ("sink",GST_PAD_SINK,GST_PAD_ALWAYS,alaw_caps, NULL);
81 gst_element_factory_add_pad_template (alawdec_factory, alawdec_src_template);
82 gst_element_factory_add_pad_template (alawdec_factory, alawdec_sink_template);
83 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (alawenc_factory));
84 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (alawdec_factory));
89 GstPluginDesc plugin_desc = {