summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager/gstrtpjitterbuffer.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-11-17 15:17:52 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-11-17 15:17:52 +0000
commitb6d0b1334923ec5d3419e3b3488868c7879b701b (patch)
tree945a07b242e15d4c0262c2f2f634fcd4d20168ff /gst/rtpmanager/gstrtpjitterbuffer.c
parent8e100b0c3d72933d1b4f70b0ebc8189cbc06b646 (diff)
downloadgst-plugins-bad-b6d0b1334923ec5d3419e3b3488868c7879b701b.tar.gz
gst-plugins-bad-b6d0b1334923ec5d3419e3b3488868c7879b701b.tar.bz2
gst-plugins-bad-b6d0b1334923ec5d3419e3b3488868c7879b701b.zip
gst/rtpmanager/gstrtpbin.c: Do not try to keep track of the clock-rate ourselves but simply get the value from the ji...
Original commit message from CVS: * gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_associate), (gst_rtp_bin_sync_chain), (create_stream), (new_ssrc_pad_found): Do not try to keep track of the clock-rate ourselves but simply get the value from the jitterbuffer. * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_jitter_buffer_sink_parse_caps), (gst_rtp_jitter_buffer_chain), (gst_rtp_jitter_buffer_get_sync): * gst/rtpmanager/gstrtpjitterbuffer.h: Add some debug info. Pass the clock-rate to the jitterbuffer. Also pass the clock-rate along with the rtp timestamp when getting the sync parameters. * gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_chain): Fix some debug. * gst/rtpmanager/rtpjitterbuffer.c: (rtp_jitter_buffer_reset_skew), (calculate_skew), (rtp_jitter_buffer_get_sync): * gst/rtpmanager/rtpjitterbuffer.h: Keep track of clock-rate changes and return the clock-rate together with the rtp timestamps used for sync. Don't try to construct timestamps when we have no base_time. * gst/rtpmanager/rtpsource.c: (get_clock_rate): Request a new clock-rate when the payload type changes. Reset the jitter calculation when the clock-rate changes.
Diffstat (limited to 'gst/rtpmanager/gstrtpjitterbuffer.c')
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 779ee5de..bd47bde4 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -851,6 +851,9 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
if (G_UNLIKELY (priv->last_pt != pt)) {
GstCaps *caps;
+ GST_DEBUG_OBJECT (jitterbuffer, "pt changed from %u to %u", priv->last_pt,
+ pt);
+
priv->last_pt = pt;
/* reset clock-rate so that we get a new one */
priv->clock_rate = -1;
@@ -865,7 +868,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
/* no clock rate given on the caps, try to get one with the signal */
gst_rtp_jitter_buffer_get_clock_rate (jitterbuffer, pt);
if (G_UNLIKELY (priv->clock_rate == -1))
- goto not_negotiated;
+ goto no_clock_rate;
}
/* take the timestamp of the buffer. This is the time when the packet was
@@ -997,9 +1000,10 @@ invalid_buffer:
gst_object_unref (jitterbuffer);
return GST_FLOW_OK;
}
-not_negotiated:
+no_clock_rate:
{
- GST_WARNING_OBJECT (jitterbuffer, "No clock-rate in caps!");
+ GST_WARNING_OBJECT (jitterbuffer,
+ "No clock-rate in caps!, dropping buffer");
gst_buffer_unref (buffer);
gst_object_unref (jitterbuffer);
return GST_FLOW_OK;
@@ -1484,7 +1488,7 @@ gst_rtp_jitter_buffer_get_property (GObject * object,
void
gst_rtp_jitter_buffer_get_sync (GstRtpJitterBuffer * buffer, guint64 * rtptime,
- guint64 * timestamp)
+ guint64 * timestamp, guint32 * clock_rate)
{
GstRtpJitterBufferPrivate *priv;
@@ -1493,6 +1497,6 @@ gst_rtp_jitter_buffer_get_sync (GstRtpJitterBuffer * buffer, guint64 * rtptime,
priv = buffer->priv;
JBUF_LOCK (priv);
- rtp_jitter_buffer_get_sync (priv->jbuf, rtptime, timestamp);
+ rtp_jitter_buffer_get_sync (priv->jbuf, rtptime, timestamp, clock_rate);
JBUF_UNLOCK (priv);
}