From: <wt...@ke...> - 2008-01-25 16:01:01
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: wtay Date: Fri Jan 25 2008 16:01:06 UTC Log message: Patch by: Olivier Crete <te...@te...> * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_jitter_buffer_sink_parse_caps), (gst_rtp_jitter_buffer_chain): * gst/rtpmanager/rtpjitterbuffer.c: (calculate_skew), (rtp_jitter_buffer_insert): * gst/rtpmanager/rtpjitterbuffer.h: Remove the fixed clock-rate from the jitterbuffer and extend it so that a clock-rate can be provided with each buffer instead. Fixes #511686. Modified files: . : ChangeLog gst/rtpmanager : gstrtpjitterbuffer.c rtpjitterbuffer.c rtpjitterbuffer.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3054&r2=1.3055 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/rtpmanager/gstrtpjitterbuffer.c.diff?r1=1.32&r2=1.33 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/rtpmanager/rtpjitterbuffer.c.diff?r1=1.11&r2=1.12 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/rtpmanager/rtpjitterbuffer.h.diff?r1=1.8&r2=1.9 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.3054 retrieving revision 1.3055 diff -u -d -r1.3054 -r1.3055 --- ChangeLog 25 Jan 2008 15:49:54 -0000 1.3054 +++ ChangeLog 25 Jan 2008 16:00:50 -0000 1.3055 @@ -3,6 +3,18 @@ Patch by: Olivier Crete <te...@te...> * gst/rtpmanager/gstrtpjitterbuffer.c: + (gst_jitter_buffer_sink_parse_caps), (gst_rtp_jitter_buffer_chain): + * gst/rtpmanager/rtpjitterbuffer.c: (calculate_skew), + (rtp_jitter_buffer_insert): + * gst/rtpmanager/rtpjitterbuffer.h: + Remove the fixed clock-rate from the jitterbuffer and extend it so that + a clock-rate can be provided with each buffer instead. Fixes #511686. + +2008-01-25 Wim Taymans <wim...@co...> + Patch by: Olivier Crete <te...@te...> + * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_rtp_jitter_buffer_init), (gst_rtp_jitter_buffer_change_state), (gst_rtp_jitter_buffer_chain), (gst_rtp_jitter_buffer_loop): Remove old unused variable. Index: gstrtpjitterbuffer.c RCS file: /cvs/gstreamer/gst-plugins-bad/gst/rtpmanager/gstrtpjitterbuffer.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- gstrtpjitterbuffer.c 25 Jan 2008 15:49:55 -0000 1.32 +++ gstrtpjitterbuffer.c 25 Jan 2008 16:00:51 -0000 1.33 @@ -451,8 +451,6 @@ if (priv->clock_rate <= 0) goto wrong_rate; - rtp_jitter_buffer_set_clock_rate (priv->jbuf, priv->clock_rate); - GST_DEBUG_OBJECT (jitterbuffer, "got clock-rate %d", priv->clock_rate); /* gah, clock-base is uint. If we don't have a base, we will use the first @@ -822,8 +820,6 @@ gst_rtp_jitter_buffer_get_clock_rate (jitterbuffer, pt); if (priv->clock_rate == -1) goto not_negotiated; - rtp_jitter_buffer_set_clock_rate (priv->jbuf, priv->clock_rate); } /* take the timestamp of the buffer. This is the time when the packet was @@ -875,7 +871,8 @@ /* now insert the packet into the queue in sorted order. This function returns * FALSE if a packet with the same seqnum was already in the queue, meaning we * have a duplicate. */ - if (!rtp_jitter_buffer_insert (priv->jbuf, buffer, timestamp, &tail)) + if (!rtp_jitter_buffer_insert (priv->jbuf, buffer, timestamp, + priv->clock_rate, &tail)) goto duplicate; /* signal addition of new buffer when the _loop is waiting. */ Index: rtpjitterbuffer.c RCS file: /cvs/gstreamer/gst-plugins-bad/gst/rtpmanager/rtpjitterbuffer.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- rtpjitterbuffer.c 10 Dec 2007 15:34:18 -0000 1.11 +++ rtpjitterbuffer.c 25 Jan 2008 16:00:51 -0000 1.12 @@ -100,22 +100,6 @@ } void -rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer * jbuf, gint clock_rate) -{ - g_return_if_fail (jbuf != NULL); - jbuf->clock_rate = clock_rate; -} -gint -rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer * jbuf) - g_return_val_if_fail (jbuf != NULL, 0); - return jbuf->clock_rate; -void rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf) { jbuf->base_time = -1; @@ -187,7 +171,8 @@ * Returns: @time adjusted with the clock skew. */ static GstClockTime -calculate_skew (RTPJitterBuffer * jbuf, guint32 rtptime, GstClockTime time) +calculate_skew (RTPJitterBuffer * jbuf, guint32 rtptime, GstClockTime time, + guint32 clock_rate) guint64 ext_rtptime; guint64 send_diff, recv_diff; @@ -198,8 +183,7 @@ ext_rtptime = gst_rtp_buffer_ext_timestamp (&jbuf->ext_rtptime, rtptime); - gstrtptime = - gst_util_uint64_scale_int (ext_rtptime, GST_SECOND, jbuf->clock_rate); + gstrtptime = gst_util_uint64_scale_int (ext_rtptime, GST_SECOND, clock_rate); again: /* first time, lock on to time and gstrtptime */ @@ -364,6 +348,7 @@ * @jbuf: an #RTPJitterBuffer * @buf: a buffer * @time: a running_time when this buffer was received in nanoseconds + * @clock_rate: the clock-rate of the payload of @buf * @tail: TRUE when the tail element changed. * * Inserts @buf into the packet queue of @jbuf. The sequence number of the @@ -374,7 +359,7 @@ gboolean rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, GstBuffer * buf, - GstClockTime time, gboolean * tail) + GstClockTime time, guint32 clock_rate, gboolean * tail) GList *list; gint func_ret = 1; @@ -398,7 +383,7 @@ * receive time, this function will retimestamp @buf with the skew corrected * running time. */ rtptime = gst_rtp_buffer_get_timestamp (buf); - time = calculate_skew (jbuf, rtptime, time); + time = calculate_skew (jbuf, rtptime, time, clock_rate); GST_BUFFER_TIMESTAMP (buf) = time; if (list) Index: rtpjitterbuffer.h RCS file: /cvs/gstreamer/gst-plugins-bad/gst/rtpmanager/rtpjitterbuffer.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- rtpjitterbuffer.h 10 Dec 2007 15:34:18 -0000 1.8 +++ rtpjitterbuffer.h 25 Jan 2008 16:00:52 -0000 1.9 @@ -54,8 +54,6 @@ GQueue *packets; - gint clock_rate; /* for calculating skew */ GstClockTime base_time; GstClockTime base_rtptime; @@ -78,13 +76,12 @@ /* managing lifetime */ RTPJitterBuffer* rtp_jitter_buffer_new (void); -void rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer *jbuf, gint clock_rate); -gint rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer *jbuf); void rtp_jitter_buffer_reset_skew (RTPJitterBuffer *jbuf); gboolean rtp_jitter_buffer_insert (RTPJitterBuffer *jbuf, GstBuffer *buf, - GstClockTime time, gboolean *tail); + GstClockTime time, + guint32 clock_rate, + gboolean *tail); GstBuffer * rtp_jitter_buffer_peek (RTPJitterBuffer *jbuf); GstBuffer * rtp_jitter_buffer_pop (RTPJitterBuffer *jbuf); |