4 #include "alaw-encode.h"
5 #include "alaw-decode.h"
7 /* elementfactory information */
8 static GstElementDetails alawenc_details = {
9 "PCM to A Law conversion",
10 "Codec/Audio/Encoder",
12 "Convert 16bit PCM to 8bit A law",
14 "Zaheer Merali <zaheer@bellworldwide.net>",
18 /* elementfactory information */
19 static GstElementDetails alawdec_details = {
20 "A Law to PCM conversion",
21 "Codec/Audio/Decoder",
23 "Convert 8bit A law to 16bit PCM",
25 "Zaheer Merali <zaheer@bellworldwide.net>",
37 "rate", GST_PROPS_INT_RANGE (8000, 192000),
38 "channels", GST_PROPS_INT_RANGE (1, 2),
50 "width", GST_PROPS_INT(16),
51 "depth", GST_PROPS_INT(16),
52 "endianness", GST_PROPS_INT(G_BYTE_ORDER),
53 "signed", GST_PROPS_BOOLEAN(TRUE),
54 "rate", GST_PROPS_INT_RANGE (8000, 192000),
55 "channels", GST_PROPS_INT_RANGE (1, 2),
59 GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
60 GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
63 plugin_init (GModule *module, GstPlugin *plugin)
65 GstElementFactory *alawenc_factory, *alawdec_factory;
66 GstCaps* alaw_caps, *linear_caps;
68 alawenc_factory = gst_element_factory_new("alawenc",GST_TYPE_ALAWENC,
70 g_return_val_if_fail(alawenc_factory != NULL, FALSE);
71 alawdec_factory = gst_element_factory_new("alawdec",GST_TYPE_ALAWDEC,
73 g_return_val_if_fail(alawdec_factory != NULL, FALSE);
74 gst_element_factory_set_rank (alawdec_factory, GST_ELEMENT_RANK_PRIMARY);
76 alaw_caps = alaw_factory ();
77 linear_caps = linear_factory ();
79 alawenc_src_template = gst_pad_template_new ("src",GST_PAD_SRC,GST_PAD_ALWAYS,alaw_caps, NULL);
80 alawenc_sink_template = gst_pad_template_new ("sink",GST_PAD_SINK,GST_PAD_ALWAYS,linear_caps, NULL);
81 gst_element_factory_add_pad_template (alawenc_factory, alawenc_src_template);
82 gst_element_factory_add_pad_template (alawenc_factory, alawenc_sink_template);
84 alawdec_src_template = gst_pad_template_new ("src",GST_PAD_SRC,GST_PAD_ALWAYS,linear_caps, NULL);
85 alawdec_sink_template = gst_pad_template_new ("sink",GST_PAD_SINK,GST_PAD_ALWAYS,alaw_caps, NULL);
87 gst_element_factory_add_pad_template (alawdec_factory, alawdec_src_template);
88 gst_element_factory_add_pad_template (alawdec_factory, alawdec_sink_template);
89 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (alawenc_factory));
90 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (alawdec_factory));
95 GstPluginDesc plugin_desc = {