mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 00:28:21 +00:00
[MOVED FROM GST-P-FARSIGHT] untabbified dtmfsrc
20070827192618-4f0f6-77d68070464f1b5f9a46cb6eec2d922340143c04.gz
This commit is contained in:
parent
09c6290b07
commit
cbf73c0d69
2 changed files with 22 additions and 22 deletions
|
@ -225,10 +225,10 @@ GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_STATIC_CAPS ("audio/x-raw-int, "
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
||||||
"width = (int) 16, "
|
"width = (int) 16, "
|
||||||
"depth = (int) 16, "
|
"depth = (int) 16, "
|
||||||
"endianness = (int) 1234, "
|
"endianness = (int) 1234, "
|
||||||
"signed = (bool) true, "
|
"signed = (bool) true, "
|
||||||
"rate = (int) 8000, "
|
"rate = (int) 8000, "
|
||||||
"channels = (int) 1")
|
"channels = (int) 1")
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
|
@ -706,7 +706,7 @@ gst_dtmf_src_create_next_tone_packet (GstDTMFSrc *dtmfsrc, GstDTMFSrcEvent *even
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (dtmfsrc, "Generating tone");
|
GST_DEBUG_OBJECT (dtmfsrc, "Generating tone");
|
||||||
gst_dtmf_src_generate_tone(event, DTMF_KEYS[event->event_number],
|
gst_dtmf_src_generate_tone(event, DTMF_KEYS[event->event_number],
|
||||||
dtmfsrc->interval, buf);
|
dtmfsrc->interval, buf);
|
||||||
}
|
}
|
||||||
event->packet_count++;
|
event->packet_count++;
|
||||||
|
|
||||||
|
@ -753,11 +753,11 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
|
||||||
|
|
||||||
if (event != NULL) {
|
if (event != NULL) {
|
||||||
if (event->event_type == DTMF_EVENT_TYPE_START) {
|
if (event->event_type == DTMF_EVENT_TYPE_START) {
|
||||||
GST_WARNING_OBJECT (dtmfsrc, "Received two consecutive DTMF start events");
|
GST_WARNING_OBJECT (dtmfsrc, "Received two consecutive DTMF start events");
|
||||||
} else if (event->event_type == DTMF_EVENT_TYPE_STOP) {
|
} else if (event->event_type == DTMF_EVENT_TYPE_STOP) {
|
||||||
gst_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
|
gst_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
|
||||||
g_free (dtmfsrc->last_event);
|
g_free (dtmfsrc->last_event);
|
||||||
dtmfsrc->last_event = NULL;
|
dtmfsrc->last_event = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,7 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
|
||||||
gst_buffer_ref(buf);
|
gst_buffer_ref(buf);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dtmfsrc,
|
GST_DEBUG_OBJECT (dtmfsrc,
|
||||||
"pushing buffer on src pad of size %d", GST_BUFFER_SIZE (buf));
|
"pushing buffer on src pad of size %d", GST_BUFFER_SIZE (buf));
|
||||||
ret = gst_pad_push (dtmfsrc->srcpad, buf);
|
ret = gst_pad_push (dtmfsrc->srcpad, buf);
|
||||||
if (ret != GST_FLOW_OK) {
|
if (ret != GST_FLOW_OK) {
|
||||||
GST_ERROR_OBJECT (dtmfsrc, "Failed to push buffer on src pad");
|
GST_ERROR_OBJECT (dtmfsrc, "Failed to push buffer on src pad");
|
||||||
|
@ -794,8 +794,8 @@ gst_dtmf_src_change_state (GstElement * element, GstStateChange transition)
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
gst_segment_init (&dtmfsrc->segment, GST_FORMAT_TIME);
|
gst_segment_init (&dtmfsrc->segment, GST_FORMAT_TIME);
|
||||||
gst_pad_push_event (dtmfsrc->srcpad, gst_event_new_new_segment (FALSE,
|
gst_pad_push_event (dtmfsrc->srcpad, gst_event_new_new_segment (FALSE,
|
||||||
dtmfsrc->segment.rate, dtmfsrc->segment.format,
|
dtmfsrc->segment.rate, dtmfsrc->segment.format,
|
||||||
dtmfsrc->segment.start, dtmfsrc->segment.stop, dtmfsrc->segment.time));
|
dtmfsrc->segment.start, dtmfsrc->segment.stop, dtmfsrc->segment.time));
|
||||||
/* Indicate that we don't do PRE_ROLL */
|
/* Indicate that we don't do PRE_ROLL */
|
||||||
no_preroll = TRUE;
|
no_preroll = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -32,13 +32,13 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_TYPE_DTMF_SRC (gst_dtmf_src_get_type())
|
#define GST_TYPE_DTMF_SRC (gst_dtmf_src_get_type())
|
||||||
#define GST_DTMF_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DTMF_SRC,GstDTMFSrc))
|
#define GST_DTMF_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DTMF_SRC,GstDTMFSrc))
|
||||||
#define GST_DTMF_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DTMF_SRC,GstDTMFSrcClass))
|
#define GST_DTMF_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DTMF_SRC,GstDTMFSrcClass))
|
||||||
#define GST_DTMF_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DTMF_SRC, GstDTMFSrcClass))
|
#define GST_DTMF_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DTMF_SRC, GstDTMFSrcClass))
|
||||||
#define GST_IS_DTMF_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DTMF_SRC))
|
#define GST_IS_DTMF_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DTMF_SRC))
|
||||||
#define GST_IS_DTMF_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DTMF_SRC))
|
#define GST_IS_DTMF_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DTMF_SRC))
|
||||||
#define GST_DTMF_SRC_CAST(obj) ((GstDTMFSrc *)(obj))
|
#define GST_DTMF_SRC_CAST(obj) ((GstDTMFSrc *)(obj))
|
||||||
|
|
||||||
typedef struct _GstDTMFSrc GstDTMFSrc;
|
typedef struct _GstDTMFSrc GstDTMFSrc;
|
||||||
typedef struct _GstDTMFSrcClass GstDTMFSrcClass;
|
typedef struct _GstDTMFSrcClass GstDTMFSrcClass;
|
||||||
|
@ -60,8 +60,8 @@ typedef enum _GstDTMFEventType GstDTMFEventType;
|
||||||
struct _GstDTMFSrcEvent {
|
struct _GstDTMFSrcEvent {
|
||||||
GstDTMFEventType event_type;
|
GstDTMFEventType event_type;
|
||||||
double sample;
|
double sample;
|
||||||
guint16 event_number;
|
guint16 event_number;
|
||||||
guint16 volume;
|
guint16 volume;
|
||||||
guint32 packet_count;
|
guint32 packet_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,12 +69,12 @@ typedef struct _GstDTMFSrcEvent GstDTMFSrcEvent;
|
||||||
|
|
||||||
struct _GstDTMFSrc {
|
struct _GstDTMFSrc {
|
||||||
GstElement element;
|
GstElement element;
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
GAsyncQueue* event_queue;
|
GAsyncQueue* event_queue;
|
||||||
GstDTMFSrcEvent* last_event;
|
GstDTMFSrcEvent* last_event;
|
||||||
|
|
||||||
guint16 interval;
|
guint16 interval;
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue