+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:
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);
GstClockTime timestamp;
guint64 latency_ts;
gboolean tail;
+ guint8 pt;
jitterbuffer = GST_RTP_JITTER_BUFFER (gst_pad_get_parent (pad));
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
}
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;
}
}
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;
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
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))