diff options
author | Olivier Crete <tester@tester.ca> | 2008-01-25 16:00:52 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-01-25 16:00:52 +0000 |
commit | 717657e696089f86490c16ee8a84f6375aecb001 (patch) | |
tree | 082404aac7e0436316c70e392c85c0f3ce06eed8 /gst/rtpmanager/rtpjitterbuffer.c | |
parent | d7599c112b59af9562e363bfae189d94973192fb (diff) | |
download | gst-plugins-bad-717657e696089f86490c16ee8a84f6375aecb001.tar.gz gst-plugins-bad-717657e696089f86490c16ee8a84f6375aecb001.tar.bz2 gst-plugins-bad-717657e696089f86490c16ee8a84f6375aecb001.zip |
gst/rtpmanager/: Remove the fixed clock-rate from the jitterbuffer and extend it so that a clock-rate can be provided...
Original commit message from CVS:
Patch by: Olivier Crete <tester@tester.ca>
* 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.
Diffstat (limited to 'gst/rtpmanager/rtpjitterbuffer.c')
-rw-r--r-- | gst/rtpmanager/rtpjitterbuffer.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c index 7ebe18e0..a2c08fb0 100644 --- a/gst/rtpmanager/rtpjitterbuffer.c +++ b/gst/rtpmanager/rtpjitterbuffer.c @@ -100,22 +100,6 @@ rtp_jitter_buffer_new (void) } 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 @@ rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf) * 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 @@ calculate_skew (RTPJitterBuffer * jbuf, guint32 rtptime, GstClockTime time) 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 @@ compare_seqnum (GstBuffer * a, GstBuffer * b, RTPJitterBuffer * jbuf) * @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 @@ compare_seqnum (GstBuffer * a, GstBuffer * b, RTPJitterBuffer * jbuf) */ 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 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, GstBuffer * buf, * 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) |