mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
gst/rtpmanager/: Small cleanups and some more debug info.
Original commit message from CVS: * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_jitter_buffer_sink_parse_caps), (gst_rtp_jitter_buffer_flush_stop), (gst_rtp_jitter_buffer_chain): * gst/rtpmanager/rtpjitterbuffer.c: (rtp_jitter_buffer_reset_skew), (calculate_skew): Small cleanups and some more debug info.
This commit is contained in:
parent
57e1c2f18a
commit
0ad14d0a45
3 changed files with 22 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
|||
2008-11-13 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* gst/rtpmanager/gstrtpjitterbuffer.c:
|
||||
(gst_jitter_buffer_sink_parse_caps),
|
||||
(gst_rtp_jitter_buffer_flush_stop), (gst_rtp_jitter_buffer_chain):
|
||||
* gst/rtpmanager/rtpjitterbuffer.c: (rtp_jitter_buffer_reset_skew),
|
||||
(calculate_skew):
|
||||
Small cleanups and some more debug info.
|
||||
|
||||
2008-11-13 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* tests/check/Makefile.am:
|
||||
|
|
|
@ -571,6 +571,7 @@ gst_rtp_jitter_buffer_flush_stop (GstRtpJitterBuffer * jitterbuffer)
|
|||
priv->next_in_seqnum = -1;
|
||||
priv->clock_rate = -1;
|
||||
priv->eos = FALSE;
|
||||
GST_DEBUG_OBJECT (jitterbuffer, "flush and reset jitterbuffer");
|
||||
rtp_jitter_buffer_flush (priv->jbuf);
|
||||
rtp_jitter_buffer_reset_skew (priv->jbuf);
|
||||
JBUF_UNLOCK (priv);
|
||||
|
@ -836,6 +837,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
|
|||
GstClockTime timestamp;
|
||||
guint64 latency_ts;
|
||||
gboolean tail;
|
||||
guint8 pt;
|
||||
|
||||
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad));
|
||||
|
||||
|
@ -844,10 +846,12 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
|
|||
|
||||
priv = jitterbuffer->priv;
|
||||
|
||||
if (G_UNLIKELY (priv->last_pt != gst_rtp_buffer_get_payload_type (buffer))) {
|
||||
pt = gst_rtp_buffer_get_payload_type (buffer);
|
||||
|
||||
if (G_UNLIKELY (priv->last_pt != pt)) {
|
||||
GstCaps *caps;
|
||||
|
||||
priv->last_pt = gst_rtp_buffer_get_payload_type (buffer);
|
||||
priv->last_pt = pt;
|
||||
/* reset clock-rate so that we get a new one */
|
||||
priv->clock_rate = -1;
|
||||
/* Try to get the clock-rate from the caps first if we can. If there are no
|
||||
|
@ -858,11 +862,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
if (G_UNLIKELY (priv->clock_rate == -1)) {
|
||||
guint8 pt;
|
||||
|
||||
/* no clock rate given on the caps, try to get one with the signal */
|
||||
pt = gst_rtp_buffer_get_payload_type (buffer);
|
||||
|
||||
gst_rtp_jitter_buffer_get_clock_rate (jitterbuffer, pt);
|
||||
if (G_UNLIKELY (priv->clock_rate == -1))
|
||||
goto not_negotiated;
|
||||
|
@ -912,6 +912,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
}
|
||||
if (G_UNLIKELY (reset)) {
|
||||
GST_DEBUG_OBJECT (jitterbuffer, "flush and reset jitterbuffer");
|
||||
rtp_jitter_buffer_flush (priv->jbuf);
|
||||
rtp_jitter_buffer_reset_skew (priv->jbuf);
|
||||
priv->last_popped_seqnum = -1;
|
||||
|
|
|
@ -111,6 +111,7 @@ rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf)
|
|||
jbuf->window_min = 0;
|
||||
jbuf->skew = 0;
|
||||
jbuf->prev_send_diff = -1;
|
||||
GST_DEBUG ("reset skew correction");
|
||||
}
|
||||
|
||||
/* For the clock skew we use a windowed low point averaging algorithm as can be
|
||||
|
@ -187,11 +188,15 @@ calculate_skew (RTPJitterBuffer * jbuf, guint32 rtptime, GstClockTime time,
|
|||
gstrtptime = gst_util_uint64_scale_int (ext_rtptime, GST_SECOND, clock_rate);
|
||||
|
||||
/* first time, lock on to time and gstrtptime */
|
||||
if (G_UNLIKELY (jbuf->base_time == -1))
|
||||
if (G_UNLIKELY (jbuf->base_time == -1)) {
|
||||
jbuf->base_time = time;
|
||||
GST_DEBUG ("Taking new base time %" GST_TIME_FORMAT, GST_TIME_ARGS (time));
|
||||
}
|
||||
if (G_UNLIKELY (jbuf->base_rtptime == -1)) {
|
||||
jbuf->base_rtptime = gstrtptime;
|
||||
jbuf->base_extrtp = ext_rtptime;
|
||||
GST_DEBUG ("Taking new base rtptime %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (gstrtptime));
|
||||
}
|
||||
|
||||
if (G_LIKELY (gstrtptime >= jbuf->base_rtptime))
|
||||
|
|
Loading…
Reference in a new issue