diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-07-12 21:48:37 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2011-08-24 12:24:18 -0400 |
commit | 1fdae5275330d7322f00e9d5c7dace30a41db477 (patch) | |
tree | de4ebc4f261c78981fb6d9783a365f7005905444 | |
parent | 4167697c0e58432447c73288b603f9a856700885 (diff) |
dtmf: Add more debug
-rw-r--r-- | gst/dtmf/gstdtmfsrc.c | 6 | ||||
-rw-r--r-- | gst/dtmf/gstrtpdtmfsrc.c | 19 |
2 files changed, 18 insertions, 7 deletions
diff --git a/gst/dtmf/gstdtmfsrc.c b/gst/dtmf/gstdtmfsrc.c index a812e98ef..7492b151e 100644 --- a/gst/dtmf/gstdtmfsrc.c +++ b/gst/dtmf/gstdtmfsrc.c @@ -611,6 +611,12 @@ gst_dtmf_src_create_next_tone_packet (GstDTMFSrc * dtmfsrc, /* timestamp and duration of GstBuffer */ GST_BUFFER_DURATION (buf) = dtmfsrc->interval * GST_MSECOND; GST_BUFFER_TIMESTAMP (buf) = dtmfsrc->timestamp; + + GST_LOG_OBJECT (dtmfsrc, "Creating new buffer with event %u duration " + " gst: %" GST_TIME_FORMAT " at %" GST_TIME_FORMAT, + event->event_number, GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); + dtmfsrc->timestamp += GST_BUFFER_DURATION (buf); /* Set caps on the buffer before pushing it */ diff --git a/gst/dtmf/gstrtpdtmfsrc.c b/gst/dtmf/gstrtpdtmfsrc.c index 875a02066..8f07cafc4 100644 --- a/gst/dtmf/gstrtpdtmfsrc.c +++ b/gst/dtmf/gstrtpdtmfsrc.c @@ -602,13 +602,6 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc * dtmfsrc, GstBuffer * buf) payload->duration = g_htons (payload->duration); - - /* duration of DTMF payloadfor the NEXT packet */ - /* not updated for redundant packets */ - if (dtmfsrc->redundancy_count <= 1) - dtmfsrc->payload->duration += dtmfsrc->ptime * dtmfsrc->clock_rate / 1000; - - if (dtmfsrc->redundancy_count <= 1 && dtmfsrc->last_packet) { GstClockTime inter_digit_interval = MIN_INTER_DIGIT_INTERVAL; @@ -619,8 +612,20 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc * dtmfsrc, GstBuffer * buf) GST_BUFFER_DURATION (buf) += inter_digit_interval * GST_MSECOND; } + GST_LOG_OBJECT (dtmfsrc, "Creating new buffer with event %u duration " + " gst: %" GST_TIME_FORMAT " at %" GST_TIME_FORMAT "(rtp ts:%u dur:%u)", + dtmfsrc->payload->event, GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), dtmfsrc->rtp_timestamp, + dtmfsrc->payload->duration); + + /* duration of DTMF payloadfor the NEXT packet */ + /* not updated for redundant packets */ + if (dtmfsrc->redundancy_count <= 1) + dtmfsrc->payload->duration += dtmfsrc->ptime * dtmfsrc->clock_rate / 1000; + if (GST_CLOCK_TIME_IS_VALID (dtmfsrc->timestamp)) dtmfsrc->timestamp += GST_BUFFER_DURATION (buf); + } static GstBuffer * |