[MOVED FROM GST-P-FARSIGHT] untabbified dtmfsrc

20070827192618-4f0f6-77d68070464f1b5f9a46cb6eec2d922340143c04.gz
This commit is contained in:
Youness Alaoui 2007-08-27 19:26:18 +00:00 committed by Edward Hervey
parent 87c552ae2b
commit 58ec497deb
2 changed files with 22 additions and 22 deletions

View file

@ -225,10 +225,10 @@ GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("audio/x-raw-int, "
"width = (int) 16, "
"depth = (int) 16, "
"endianness = (int) 1234, "
"signed = (bool) true, "
"endianness = (int) 1234, "
"signed = (bool) true, "
"rate = (int) 8000, "
"channels = (int) 1")
"channels = (int) 1")
);
static GstElementClass *parent_class = NULL;
@ -706,7 +706,7 @@ gst_dtmf_src_create_next_tone_packet (GstDTMFSrc *dtmfsrc, GstDTMFSrcEvent *even
} else {
GST_DEBUG_OBJECT (dtmfsrc, "Generating tone");
gst_dtmf_src_generate_tone(event, DTMF_KEYS[event->event_number],
dtmfsrc->interval, buf);
dtmfsrc->interval, buf);
}
event->packet_count++;
@ -753,11 +753,11 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
if (event != NULL) {
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) {
gst_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
g_free (dtmfsrc->last_event);
dtmfsrc->last_event = NULL;
gst_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
g_free (dtmfsrc->last_event);
dtmfsrc->last_event = NULL;
}
}
}
@ -769,7 +769,7 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
gst_buffer_ref(buf);
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);
if (ret != GST_FLOW_OK) {
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:
gst_segment_init (&dtmfsrc->segment, GST_FORMAT_TIME);
gst_pad_push_event (dtmfsrc->srcpad, gst_event_new_new_segment (FALSE,
dtmfsrc->segment.rate, dtmfsrc->segment.format,
dtmfsrc->segment.start, dtmfsrc->segment.stop, dtmfsrc->segment.time));
dtmfsrc->segment.rate, dtmfsrc->segment.format,
dtmfsrc->segment.start, dtmfsrc->segment.stop, dtmfsrc->segment.time));
/* Indicate that we don't do PRE_ROLL */
no_preroll = TRUE;
break;

View file

@ -32,13 +32,13 @@
G_BEGIN_DECLS
#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_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DTMF_SRC,GstDTMFSrcClass))
#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_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_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_DTMF_SRC_CAST(obj) ((GstDTMFSrc *)(obj))
#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_DTMF_SRC_CAST(obj) ((GstDTMFSrc *)(obj))
typedef struct _GstDTMFSrc GstDTMFSrc;
typedef struct _GstDTMFSrcClass GstDTMFSrcClass;
@ -60,8 +60,8 @@ typedef enum _GstDTMFEventType GstDTMFEventType;
struct _GstDTMFSrcEvent {
GstDTMFEventType event_type;
double sample;
guint16 event_number;
guint16 volume;
guint16 event_number;
guint16 volume;
guint32 packet_count;
};
@ -69,12 +69,12 @@ typedef struct _GstDTMFSrcEvent GstDTMFSrcEvent;
struct _GstDTMFSrc {
GstElement element;
GstPad *srcpad;
GstPad *srcpad;
GstSegment segment;
GAsyncQueue* event_queue;
GAsyncQueue* event_queue;
GstDTMFSrcEvent* last_event;
guint16 interval;
guint16 interval;
GstClockTime timestamp;
};