Moving lame mp3 encoder plugin from -ugly
[platform/upstream/gst-plugins-good.git] / gst / dtmf / gstdtmfcommon.h
1 /* GStreamer DTMF plugin
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 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., 51 Franklin St, Fifth Floor,
16  * Boston, MA 02110-1301, USA.
17  */
18
19 #ifndef __GST_RTP_DTMF_COMMON_H__
20 #define __GST_RTP_DTMF_COMMON_H__
21
22 #include <gst/math-compat.h>
23
24 #define MIN_INTER_DIGIT_INTERVAL 100     /* ms */
25 #define MIN_PULSE_DURATION       250     /* ms */
26
27 #define MIN_VOLUME               0
28 #define MAX_VOLUME               36
29
30 #define MIN_EVENT                0
31 #define MAX_EVENT                15
32 #define MIN_EVENT_STRING         "0"
33 #define MAX_EVENT_STRING         "15"
34
35 typedef struct
36 {
37   unsigned event:8;             /* Current DTMF event */
38 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
39   unsigned volume:6;            /* power level of the tone, in dBm0 */
40   unsigned r:1;                 /* Reserved-bit */
41   unsigned e:1;                 /* End-bit */
42 #elif G_BYTE_ORDER == G_BIG_ENDIAN
43   unsigned e:1;                 /* End-bit */
44   unsigned r:1;                 /* Reserved-bit */
45   unsigned volume:6;            /* power level of the tone, in dBm0 */
46 #else
47 #error "G_BYTE_ORDER should be big or little endian."
48 #endif
49   unsigned duration:16;         /* Duration of digit, in timestamp units */
50 } GstRTPDTMFPayload;
51
52 #endif /* __GST_RTP_DTMF_COMMON_H__ */