1 #include "mulaw-encode.h"
2 #include "mulaw-decode.h"
4 /* elementfactory information */
5 static GstElementDetails mulawenc_details = {
6 "PCM to Mu Law conversion",
7 "Filter/Audio/Conversion",
9 "Convert 16bit PCM to 8bit mu law",
11 "Zaheer Merali <zaheer@bellworldwide.net>",
15 /* elementfactory information */
16 static GstElementDetails mulawdec_details = {
17 "Mu Law to PCM conversion",
18 "Filter/Audio/Conversion",
20 "Convert 8bit mu law to 16bit PCM",
22 "Zaheer Merali <zaheer@bellworldwide.net>",
34 "format", GST_PROPS_STRING ("int"),
35 "law", GST_PROPS_INT (1),
36 "width", GST_PROPS_INT(8),
37 "depth", GST_PROPS_INT(8),
38 "signed", GST_PROPS_BOOLEAN(FALSE),
50 "format", GST_PROPS_STRING ("int"),
51 "law", GST_PROPS_INT(0),
52 "width", GST_PROPS_INT(16),
53 "depth", GST_PROPS_INT(16),
54 "signed", GST_PROPS_BOOLEAN(TRUE),
55 "endianness", GST_PROPS_INT(G_BYTE_ORDER),
59 GstPadTemplate *mulawenc_src_template, *mulawenc_sink_template;
60 GstPadTemplate *mulawdec_src_template, *mulawdec_sink_template;
63 plugin_init (GModule *module, GstPlugin *plugin)
65 GstElementFactory *mulawenc_factory, *mulawdec_factory;
66 GstCaps* mulaw_caps, *linear_caps;
68 mulawenc_factory = gst_element_factory_new("mulawenc",GST_TYPE_MULAWENC,
70 g_return_val_if_fail(mulawenc_factory != NULL, FALSE);
71 mulawdec_factory = gst_element_factory_new("mulawdec",GST_TYPE_MULAWDEC,
73 g_return_val_if_fail(mulawdec_factory != NULL, FALSE);
74 gst_element_factory_set_rank (mulawdec_factory, GST_ELEMENT_RANK_PRIMARY);
76 mulaw_caps = mulaw_factory ();
77 linear_caps = linear_factory ();
79 mulawenc_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
81 mulawenc_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
84 gst_element_factory_add_pad_template (mulawenc_factory, mulawenc_src_template);
85 gst_element_factory_add_pad_template (mulawenc_factory, mulawenc_sink_template);
87 mulawdec_src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
89 mulawdec_sink_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
92 gst_element_factory_add_pad_template (mulawdec_factory, mulawdec_src_template);
93 gst_element_factory_add_pad_template (mulawdec_factory, mulawdec_sink_template);
95 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (mulawenc_factory));
96 gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (mulawdec_factory));
103 GstPluginDesc plugin_desc = {