1 /* GStreamer PCM/A-Law conversions
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 02111-1307, USA.
23 #include "alaw-encode.h"
24 #include "alaw-decode.h"
29 return gst_caps_new_simple ("audio/x-alaw",
30 "rate", GST_TYPE_INT_RANGE, 8000, 192000,
31 "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
37 return gst_caps_new_simple ("audio/x-raw-int",
38 "width", G_TYPE_INT, 16,
39 "depth", G_TYPE_INT, 16,
40 "endianness", G_TYPE_INT, G_BYTE_ORDER,
41 "signed", G_TYPE_BOOLEAN, TRUE,
42 "rate", GST_TYPE_INT_RANGE, 8000, 192000,
43 "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
46 GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
47 GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
50 plugin_init (GstPlugin * plugin)
52 GstCaps *alaw_caps, *linear_caps;
54 alaw_caps = alaw_factory ();
55 linear_caps = linear_factory ();
57 alawenc_src_template =
58 gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, alaw_caps);
59 alawenc_sink_template =
60 gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, linear_caps);
62 alawdec_src_template =
63 gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, linear_caps);
64 alawdec_sink_template =
65 gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, alaw_caps);
67 if (!gst_element_register (plugin, "alawenc",
68 GST_RANK_NONE, GST_TYPE_ALAW_ENC) ||
69 !gst_element_register (plugin, "alawdec",
70 GST_RANK_PRIMARY, GST_TYPE_ALAW_DEC))
76 /* FIXME 0.11: merge alaw and mulaw into one plugin? */
77 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
80 "ALaw audio conversion routines",
81 plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)