1 /* GStreamer PCM/A-Law conversions |
|
2 * |
|
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. |
|
7 * |
|
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. |
|
12 * |
|
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. |
|
17 */ |
|
18 |
|
19 #ifdef HAVE_CONFIG_H |
|
20 #include "config.h" |
|
21 #endif |
|
22 #include "mulaw-encode.h" |
|
23 #include "mulaw-decode.h" |
|
24 |
|
25 GstStaticPadTemplate mulaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src", |
|
26 GST_PAD_SRC, |
|
27 GST_PAD_ALWAYS, |
|
28 GST_STATIC_CAPS ("audio/x-raw-int, " |
|
29 "rate = (int) [ 8000, 192000 ], " |
|
30 "channels = (int) [ 1, 2 ], " |
|
31 "endianness = (int) BYTE_ORDER, " |
|
32 "width = (int) 16, " "depth = (int) 16, " "signed = (boolean) True") |
|
33 ); |
|
34 |
|
35 GstStaticPadTemplate mulaw_dec_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", |
|
36 GST_PAD_SINK, |
|
37 GST_PAD_ALWAYS, |
|
38 GST_STATIC_CAPS ("audio/x-mulaw, " |
|
39 "rate = [ 8000 , 192000 ], " "channels = [ 1 , 2 ]") |
|
40 ); |
|
41 |
|
42 GstStaticPadTemplate mulaw_enc_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", |
|
43 GST_PAD_SINK, |
|
44 GST_PAD_ALWAYS, |
|
45 GST_STATIC_CAPS ("audio/x-raw-int, " |
|
46 "rate = (int) [ 8000, 192000 ], " |
|
47 "channels = (int) [ 1, 2 ], " |
|
48 "endianness = (int) BYTE_ORDER, " |
|
49 "width = (int) 16, " "depth = (int) 16, " "signed = (boolean) True") |
|
50 ); |
|
51 |
|
52 GstStaticPadTemplate mulaw_enc_src_factory = GST_STATIC_PAD_TEMPLATE ("src", |
|
53 GST_PAD_SRC, |
|
54 GST_PAD_ALWAYS, |
|
55 GST_STATIC_CAPS ("audio/x-mulaw, " |
|
56 "rate = [ 8000 , 192000 ], " "channels = [ 1 , 2 ]") |
|
57 ); |
|
58 |
|
59 static gboolean |
|
60 plugin_init (GstPlugin * plugin) |
|
61 { |
|
62 if (!gst_element_register (plugin, "mulawenc", |
|
63 GST_RANK_NONE, GST_TYPE_MULAWENC) || |
|
64 !gst_element_register (plugin, "mulawdec", |
|
65 GST_RANK_PRIMARY, GST_TYPE_MULAWDEC)) |
|
66 return FALSE; |
|
67 |
|
68 return TRUE; |
|
69 } |
|
70 |
|
71 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, |
|
72 GST_VERSION_MINOR, |
|
73 "mulaw", |
|
74 "MuLaw audio conversion routines", |
|
75 plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) |
|
76 |
|
77 |
|
78 EXPORT_C GstPluginDesc* _GST_PLUGIN_DESC() |
|
79 { |
|
80 return &gst_plugin_desc; |
|
81 } |
|