mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 10:59:39 +00:00
[MOVED FROM GST-P-FARSIGHT] Fix overly long lines and tabs
20070827195610-3e2dc-396a3fa01e16f184e4109c71fe2deb6e516bdf0d.gz
This commit is contained in:
parent
cbf73c0d69
commit
a8e4a3007e
2 changed files with 49 additions and 35 deletions
|
@ -269,13 +269,13 @@ static void gst_dtmf_src_get_property (GObject * object, guint prop_id,
|
||||||
static gboolean gst_dtmf_src_handle_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_dtmf_src_handle_event (GstPad * pad, GstEvent * event);
|
||||||
static GstStateChangeReturn gst_dtmf_src_change_state (GstElement * element,
|
static GstStateChangeReturn gst_dtmf_src_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
static void gst_dtmf_src_generate_tone(GstDTMFSrcEvent *event, DTMF_KEY key, float duration,
|
static void gst_dtmf_src_generate_tone(GstDTMFSrcEvent *event, DTMF_KEY key,
|
||||||
GstBuffer * buffer);
|
float duration, GstBuffer * buffer);
|
||||||
static void gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc);
|
static void gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc);
|
||||||
static void gst_dtmf_src_start (GstDTMFSrc *dtmfsrc);
|
static void gst_dtmf_src_start (GstDTMFSrc *dtmfsrc);
|
||||||
static void gst_dtmf_src_stop (GstDTMFSrc *dtmfsrc);
|
static void gst_dtmf_src_stop (GstDTMFSrc *dtmfsrc);
|
||||||
static void gst_dtmf_src_add_start_event (GstDTMFSrc *dtmfsrc, gint event_number,
|
static void gst_dtmf_src_add_start_event (GstDTMFSrc *dtmfsrc,
|
||||||
gint event_volume);
|
gint event_number, gint event_volume);
|
||||||
static void gst_dtmf_src_add_stop_event (GstDTMFSrc *dtmfsrc);
|
static void gst_dtmf_src_add_stop_event (GstDTMFSrc *dtmfsrc);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -615,7 +615,8 @@ gst_dtmf_src_generate_silence(GstBuffer * buffer, float duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_dtmf_src_generate_tone(GstDTMFSrcEvent *event, DTMF_KEY key, float duration, GstBuffer * buffer)
|
gst_dtmf_src_generate_tone(GstDTMFSrcEvent *event, DTMF_KEY key, float duration,
|
||||||
|
GstBuffer * buffer)
|
||||||
{
|
{
|
||||||
gint16 *p;
|
gint16 *p;
|
||||||
gint tone_size;
|
gint tone_size;
|
||||||
|
@ -686,12 +687,14 @@ gst_dtmf_src_wait_for_buffer_ts (GstDTMFSrc *dtmfsrc, GstBuffer * buf)
|
||||||
|
|
||||||
|
|
||||||
static GstBuffer *
|
static GstBuffer *
|
||||||
gst_dtmf_src_create_next_tone_packet (GstDTMFSrc *dtmfsrc, GstDTMFSrcEvent *event)
|
gst_dtmf_src_create_next_tone_packet (GstDTMFSrc *dtmfsrc,
|
||||||
|
GstDTMFSrcEvent *event)
|
||||||
{
|
{
|
||||||
GstBuffer *buf = NULL;
|
GstBuffer *buf = NULL;
|
||||||
gboolean send_silence = FALSE;
|
gboolean send_silence = FALSE;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dtmfsrc, "Creating buffer for tone %s", DTMF_KEYS[event->event_number].event_name);
|
GST_DEBUG_OBJECT (dtmfsrc, "Creating buffer for tone %s",
|
||||||
|
DTMF_KEYS[event->event_number].event_name);
|
||||||
|
|
||||||
/* create buffer to hold the tone */
|
/* create buffer to hold the tone */
|
||||||
buf = gst_buffer_new ();
|
buf = gst_buffer_new ();
|
||||||
|
@ -738,7 +741,8 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
|
||||||
event = g_async_queue_pop (dtmfsrc->event_queue);
|
event = g_async_queue_pop (dtmfsrc->event_queue);
|
||||||
|
|
||||||
if (event->event_type == DTMF_EVENT_TYPE_STOP) {
|
if (event->event_type == DTMF_EVENT_TYPE_STOP) {
|
||||||
GST_WARNING_OBJECT (dtmfsrc, "Received a DTMF stop event when already stopped");
|
GST_WARNING_OBJECT (dtmfsrc,
|
||||||
|
"Received a DTMF stop event when already stopped");
|
||||||
} else if (event->event_type == DTMF_EVENT_TYPE_START) {
|
} else if (event->event_type == DTMF_EVENT_TYPE_START) {
|
||||||
gst_dtmf_prepare_timestamps (dtmfsrc);
|
gst_dtmf_prepare_timestamps (dtmfsrc);
|
||||||
|
|
||||||
|
@ -748,12 +752,14 @@ gst_dtmf_src_push_next_tone_packet (GstDTMFSrc *dtmfsrc)
|
||||||
event->packet_count = 0;
|
event->packet_count = 0;
|
||||||
dtmfsrc->last_event = event;
|
dtmfsrc->last_event = event;
|
||||||
}
|
}
|
||||||
} else if (dtmfsrc->last_event->packet_count * dtmfsrc->interval >= MIN_DUTY_CYCLE) {
|
} else if (dtmfsrc->last_event->packet_count * dtmfsrc->interval >=
|
||||||
|
MIN_DUTY_CYCLE) {
|
||||||
event = g_async_queue_try_pop (dtmfsrc->event_queue);
|
event = g_async_queue_try_pop (dtmfsrc->event_queue);
|
||||||
|
|
||||||
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);
|
||||||
|
@ -795,7 +801,8 @@ gst_dtmf_src_change_state (GstElement * element, GstStateChange transition)
|
||||||
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;
|
||||||
|
|
|
@ -90,8 +90,8 @@
|
||||||
* <entry>method</entry>
|
* <entry>method</entry>
|
||||||
* <entry>G_TYPE_INT</entry>
|
* <entry>G_TYPE_INT</entry>
|
||||||
* <entry>1</entry>
|
* <entry>1</entry>
|
||||||
* <entry>The method used for sending event, this element will react if this field
|
* <entry>The method used for sending event, this element will react if this
|
||||||
* is absent or 1.
|
* field is absent or 1.
|
||||||
* </entry>
|
* </entry>
|
||||||
* </row>
|
* </row>
|
||||||
* </tbody>
|
* </tbody>
|
||||||
|
@ -685,7 +685,8 @@ gst_rtp_dtmf_src_wait_for_buffer_ts (GstRTPDTMFSrc *dtmfsrc, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtp_dtmf_prepare_rtp_headers (GstRTPDTMFSrc *dtmfsrc, GstRTPDTMFSrcEvent *event, GstBuffer *buf)
|
gst_rtp_dtmf_prepare_rtp_headers (GstRTPDTMFSrc *dtmfsrc,
|
||||||
|
GstRTPDTMFSrcEvent *event, GstBuffer *buf)
|
||||||
{
|
{
|
||||||
gst_rtp_buffer_set_ssrc (buf, dtmfsrc->current_ssrc);
|
gst_rtp_buffer_set_ssrc (buf, dtmfsrc->current_ssrc);
|
||||||
gst_rtp_buffer_set_payload_type (buf, dtmfsrc->pt);
|
gst_rtp_buffer_set_payload_type (buf, dtmfsrc->pt);
|
||||||
|
@ -705,7 +706,8 @@ gst_rtp_dtmf_prepare_rtp_headers (GstRTPDTMFSrc *dtmfsrc, GstRTPDTMFSrcEvent *ev
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc, GstRTPDTMFSrcEvent *event,GstBuffer *buf)
|
gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc,
|
||||||
|
GstRTPDTMFSrcEvent *event,GstBuffer *buf)
|
||||||
{
|
{
|
||||||
GstRTPDTMFPayload *payload;
|
GstRTPDTMFPayload *payload;
|
||||||
|
|
||||||
|
@ -735,7 +737,8 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc, GstRTPDTMFSrcEvent *ev
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstBuffer *
|
static GstBuffer *
|
||||||
gst_rtp_dtmf_src_create_next_rtp_packet (GstRTPDTMFSrc *dtmfsrc, GstRTPDTMFSrcEvent *event)
|
gst_rtp_dtmf_src_create_next_rtp_packet (GstRTPDTMFSrc *dtmfsrc,
|
||||||
|
GstRTPDTMFSrcEvent *event)
|
||||||
{
|
{
|
||||||
GstBuffer *buf = NULL;
|
GstBuffer *buf = NULL;
|
||||||
|
|
||||||
|
@ -769,7 +772,8 @@ gst_rtp_dtmf_src_push_next_rtp_packet (GstRTPDTMFSrc *dtmfsrc)
|
||||||
event = g_async_queue_pop (dtmfsrc->event_queue);
|
event = g_async_queue_pop (dtmfsrc->event_queue);
|
||||||
|
|
||||||
if (event->event_type == RTP_DTMF_EVENT_TYPE_STOP) {
|
if (event->event_type == RTP_DTMF_EVENT_TYPE_STOP) {
|
||||||
GST_WARNING_OBJECT (dtmfsrc, "Received a DTMF stop event when already stopped");
|
GST_WARNING_OBJECT (dtmfsrc,
|
||||||
|
"Received a DTMF stop event when already stopped");
|
||||||
} else if (event->event_type == RTP_DTMF_EVENT_TYPE_START) {
|
} else if (event->event_type == RTP_DTMF_EVENT_TYPE_START) {
|
||||||
|
|
||||||
dtmfsrc->first_packet = TRUE;
|
dtmfsrc->first_packet = TRUE;
|
||||||
|
@ -783,12 +787,14 @@ gst_rtp_dtmf_src_push_next_rtp_packet (GstRTPDTMFSrc *dtmfsrc)
|
||||||
|
|
||||||
dtmfsrc->last_event = event;
|
dtmfsrc->last_event = event;
|
||||||
}
|
}
|
||||||
} else if (dtmfsrc->last_event->sent_packets * dtmfsrc->interval >= MIN_PULSE_DURATION){
|
} else if (dtmfsrc->last_event->sent_packets * dtmfsrc->interval >=
|
||||||
|
MIN_PULSE_DURATION){
|
||||||
event = g_async_queue_try_pop (dtmfsrc->event_queue);
|
event = g_async_queue_try_pop (dtmfsrc->event_queue);
|
||||||
|
|
||||||
if (event != NULL) {
|
if (event != NULL) {
|
||||||
if (event->event_type == RTP_DTMF_EVENT_TYPE_START) {
|
if (event->event_type == RTP_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 == RTP_DTMF_EVENT_TYPE_STOP) {
|
} else if (event->event_type == RTP_DTMF_EVENT_TYPE_STOP) {
|
||||||
dtmfsrc->first_packet = FALSE;
|
dtmfsrc->first_packet = FALSE;
|
||||||
dtmfsrc->last_packet = TRUE;
|
dtmfsrc->last_packet = TRUE;
|
||||||
|
@ -815,7 +821,8 @@ gst_rtp_dtmf_src_push_next_rtp_packet (GstRTPDTMFSrc *dtmfsrc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create buffer to hold the payload */
|
/* create buffer to hold the payload */
|
||||||
buf = gst_rtp_dtmf_src_create_next_rtp_packet (dtmfsrc, dtmfsrc->last_event);
|
buf = gst_rtp_dtmf_src_create_next_rtp_packet (dtmfsrc,
|
||||||
|
dtmfsrc->last_event);
|
||||||
|
|
||||||
while ( redundancy_count-- ) {
|
while ( redundancy_count-- ) {
|
||||||
gst_buffer_ref(buf);
|
gst_buffer_ref(buf);
|
||||||
|
|
Loading…
Reference in a new issue