2013-03-09 01:18:30 +00:00
|
|
|
/* GStreamer DTMF plugin
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
2008-03-20 00:51:47 +00:00
|
|
|
|
|
|
|
#ifndef __GST_RTP_DTMF_COMMON_H__
|
|
|
|
#define __GST_RTP_DTMF_COMMON_H__
|
|
|
|
|
2013-03-09 01:18:30 +00:00
|
|
|
#include <gst/math-compat.h>
|
|
|
|
|
2011-04-14 01:58:36 +00:00
|
|
|
#define MIN_INTER_DIGIT_INTERVAL 100 /* ms */
|
|
|
|
#define MIN_PULSE_DURATION 250 /* ms */
|
|
|
|
|
|
|
|
#define MIN_VOLUME 0
|
|
|
|
#define MAX_VOLUME 36
|
|
|
|
|
|
|
|
#define MIN_EVENT 0
|
2011-07-12 23:09:02 +00:00
|
|
|
#define MAX_EVENT 15
|
2011-04-14 01:58:36 +00:00
|
|
|
#define MIN_EVENT_STRING "0"
|
2011-07-12 23:09:02 +00:00
|
|
|
#define MAX_EVENT_STRING "15"
|
2011-04-14 01:58:36 +00:00
|
|
|
|
2009-02-20 22:37:43 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned event:8; /* Current DTMF event */
|
2008-03-20 00:51:47 +00:00
|
|
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
2009-02-20 22:37:43 +00:00
|
|
|
unsigned volume:6; /* power level of the tone, in dBm0 */
|
|
|
|
unsigned r:1; /* Reserved-bit */
|
|
|
|
unsigned e:1; /* End-bit */
|
2008-03-20 00:51:47 +00:00
|
|
|
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
2009-02-20 22:37:43 +00:00
|
|
|
unsigned e:1; /* End-bit */
|
|
|
|
unsigned r:1; /* Reserved-bit */
|
|
|
|
unsigned volume:6; /* power level of the tone, in dBm0 */
|
2008-03-20 00:51:47 +00:00
|
|
|
#else
|
|
|
|
#error "G_BYTE_ORDER should be big or little endian."
|
|
|
|
#endif
|
2009-02-20 22:37:43 +00:00
|
|
|
unsigned duration:16; /* Duration of digit, in timestamp units */
|
2008-03-20 00:51:47 +00:00
|
|
|
} GstRTPDTMFPayload;
|
|
|
|
|
|
|
|
#endif /* __GST_RTP_DTMF_COMMON_H__ */
|