mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 17:50:36 +00:00
[MOVED FROM GST-P-FARSIGHT] Use segment to calculate dtmfsrc rtp timestamp
20070412200435-3e2dc-b5cc26b12b6e8b89f131fd27f0e4627746e85697.gz
This commit is contained in:
parent
50dbdcc4e1
commit
516f1cb727
2 changed files with 22 additions and 2 deletions
|
@ -391,6 +391,22 @@ gst_rtp_dtmf_src_handle_event (GstPad * pad, GstEvent * event)
|
||||||
gst_rtp_dtmf_src_stop (dtmfsrc);
|
gst_rtp_dtmf_src_stop (dtmfsrc);
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case GST_EVENT_FLUSH_STOP:
|
||||||
|
gst_segment_init (&dtmfsrc->segment, GST_FORMAT_UNDEFINED);
|
||||||
|
break;
|
||||||
|
case GST_EVENT_NEWSEGMENT:
|
||||||
|
{
|
||||||
|
gboolean update;
|
||||||
|
gdouble rate;
|
||||||
|
GstFormat fmt;
|
||||||
|
gint64 start, stop, position;
|
||||||
|
|
||||||
|
gst_event_parse_new_segment (event, &update, &rate, &fmt, &start, &stop,
|
||||||
|
&position);
|
||||||
|
gst_segment_set_newsegment (&dtmfsrc->segment, update, rate, fmt,
|
||||||
|
start, stop, position);
|
||||||
|
}
|
||||||
|
/* fallthrough */
|
||||||
default:
|
default:
|
||||||
result = gst_pad_event_default (pad, event);
|
result = gst_pad_event_default (pad, event);
|
||||||
break;
|
break;
|
||||||
|
@ -497,8 +513,9 @@ gst_rtp_dtmf_prepare_timestamps (GstRTPDTMFSrc *dtmfsrc)
|
||||||
|
|
||||||
dtmfsrc->rtp_timestamp = dtmfsrc->ts_base +
|
dtmfsrc->rtp_timestamp = dtmfsrc->ts_base +
|
||||||
gst_util_uint64_scale_int (
|
gst_util_uint64_scale_int (
|
||||||
dtmfsrc->timestamp - gst_element_get_base_time (GST_ELEMENT (dtmfsrc)),
|
gst_segment_to_running_time (&dtmfsrc->segment, GST_FORMAT_TIME,
|
||||||
dtmfsrc->clock_rate, GST_SECOND);
|
dtmfsrc->timestamp - gst_element_get_base_time (GST_ELEMENT (dtmfsrc))),
|
||||||
|
dtmfsrc->clock_rate, GST_SECOND);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -676,6 +693,8 @@ gst_rtp_dtmf_src_set_caps (GstRTPDTMFSrc *dtmfsrc)
|
||||||
static void
|
static void
|
||||||
gst_rtp_dtmf_src_ready_to_paused (GstRTPDTMFSrc *dtmfsrc)
|
gst_rtp_dtmf_src_ready_to_paused (GstRTPDTMFSrc *dtmfsrc)
|
||||||
{
|
{
|
||||||
|
gst_segment_init (&dtmfsrc->segment, GST_FORMAT_UNDEFINED);
|
||||||
|
|
||||||
if (dtmfsrc->ssrc == -1)
|
if (dtmfsrc->ssrc == -1)
|
||||||
dtmfsrc->current_ssrc = g_random_int ();
|
dtmfsrc->current_ssrc = g_random_int ();
|
||||||
else
|
else
|
||||||
|
|
|
@ -83,6 +83,7 @@ struct _GstRTPDTMFSrc {
|
||||||
gboolean first_packet;
|
gboolean first_packet;
|
||||||
|
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
|
GstSegment segment;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstRTPDTMFSrcClass {
|
struct _GstRTPDTMFSrcClass {
|
||||||
|
|
Loading…
Reference in a new issue