Centralize duplicated constants so they have the same value.
Also standardise minimum tone duration to 250ms and minimum inter-tone
interval to 100ms.
gstdtmfdetect.h \
gstrtpdtmfsrc.h \
gstrtpdtmfdepay.h \
- gstrtpdtmfcommon.h \
+ gstdtmfcommon.h \
tone_detect.h
libgstdtmf_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
#ifndef __GST_RTP_DTMF_COMMON_H__
#define __GST_RTP_DTMF_COMMON_H__
+#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
+#define MAX_EVENT 16
+#define MIN_EVENT_STRING "0"
+#define MAX_EVENT_STRING "16"
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846 /* pi */
+#endif
typedef struct
{
#include <glib.h>
-#ifndef M_PI
-#define M_PI 3.14159265358979323846 /* pi */
-#endif
-
+#include "gstdtmfcommon.h"
#include "gstdtmfsrc.h"
#define DEFAULT_SAMPLE_RATE 8000
#define SAMPLE_SIZE 16
#define CHANNELS 1
-#define MIN_EVENT 0
-#define MAX_EVENT 16
-#define MIN_VOLUME 0
-#define MAX_VOLUME 36
-#define MIN_INTER_DIGIT_INTERVAL 100
-#define MIN_PULSE_DURATION 250
#define MIN_DUTY_CYCLE (MIN_INTER_DIGIT_INTERVAL + MIN_PULSE_DURATION)
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
#endif
#include <string.h>
#include <gst/rtp/gstrtpbuffer.h>
#include "gstrtpdtmfdepay.h"
-#ifndef M_PI
-# define M_PI 3.14159265358979323846 /* pi */
-#endif
-
-
#define DEFAULT_PACKET_INTERVAL 50 /* ms */
#define MIN_PACKET_INTERVAL 10 /* ms */
#define MAX_PACKET_INTERVAL 50 /* ms */
#define SAMPLE_RATE 8000
#define SAMPLE_SIZE 16
#define CHANNELS 1
-#define MIN_EVENT 0
-#define MAX_EVENT 16
-#define MIN_VOLUME 0
-#define MAX_VOLUME 36
-#define MIN_INTER_DIGIT_INTERVAL 100
-#define MIN_PULSE_DURATION 250
#define MIN_DUTY_CYCLE (MIN_INTER_DIGIT_INTERVAL + MIN_PULSE_DURATION)
#define MIN_UNIT_TIME 0
#include <gst/base/gstadapter.h>
#include <gst/rtp/gstbasertpdepayload.h>
-#include "gstrtpdtmfcommon.h"
+#include "gstdtmfcommon.h"
G_BEGIN_DECLS
#define GST_TYPE_RTP_DTMF_DEPAY \
#define DEFAULT_TIMESTAMP_OFFSET -1
#define DEFAULT_SEQNUM_OFFSET -1
#define DEFAULT_CLOCK_RATE 8000
-#define MIN_EVENT 0
-#define MAX_EVENT 16
-#define MIN_EVENT_STRING "0"
-#define MAX_EVENT_STRING "16"
-#define MIN_VOLUME 0
-#define MAX_VOLUME 36
-
-#define MIN_INTER_DIGIT_INTERVAL 50 /* ms */
-#define MIN_PULSE_DURATION 70 /* ms */
#define DEFAULT_PACKET_REDUNDANCY 1
#define MIN_PACKET_REDUNDANCY 1
#include <gst/base/gstbasesrc.h>
#include <gst/rtp/gstrtpbuffer.h>
-#include "gstrtpdtmfcommon.h"
+#include "gstdtmfcommon.h"
G_BEGIN_DECLS
#define GST_TYPE_RTP_DTMF_SRC (gst_rtp_dtmf_src_get_type())