diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-10-05 12:07:37 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-10-05 12:07:37 +0000 |
commit | 6e5d23b3d7ab28343a29ff4af7dc65d6a31e79ae (patch) | |
tree | 9a6b04a3b182fef5cacbf49bd69e2914cc915510 /gst/rtpmanager/rtpjitterbuffer.c | |
parent | 69c24a99e4afcd74f1852fd8a426e4449e651564 (diff) | |
download | gst-plugins-bad-6e5d23b3d7ab28343a29ff4af7dc65d6a31e79ae.tar.gz gst-plugins-bad-6e5d23b3d7ab28343a29ff4af7dc65d6a31e79ae.tar.bz2 gst-plugins-bad-6e5d23b3d7ab28343a29ff4af7dc65d6a31e79ae.zip |
gst/rtpmanager/gstrtpjitterbuffer.c: Only peek at the tail element instead of popping it off, which allows us to grea...
Original commit message from CVS:
* gst/rtpmanager/gstrtpjitterbuffer.c:
(gst_rtp_jitter_buffer_chain), (gst_rtp_jitter_buffer_loop):
Only peek at the tail element instead of popping it off, which allows
us to greatly simplify things when the tail element changes.
* gst/rtpmanager/gstrtpsession.c:
(gst_rtp_session_event_recv_rtp_sink):
* gst/rtpmanager/gstrtpssrcdemux.c:
(gst_rtp_ssrc_demux_sink_event):
Forward FLUSH events instead of leaking them.
* gst/rtpmanager/rtpjitterbuffer.c: (rtp_jitter_buffer_reset_skew),
(calculate_skew), (rtp_jitter_buffer_insert):
* gst/rtpmanager/rtpjitterbuffer.h:
Remove the tail-changed callback in favour of a simple boolean when we
insert a buffer in the queue.
Add method to peek the tail of the buffer.
Diffstat (limited to 'gst/rtpmanager/rtpjitterbuffer.c')
-rw-r--r-- | gst/rtpmanager/rtpjitterbuffer.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/gst/rtpmanager/rtpjitterbuffer.c b/gst/rtpmanager/rtpjitterbuffer.c index a002cc38..f3c2a2ab 100644 --- a/gst/rtpmanager/rtpjitterbuffer.c +++ b/gst/rtpmanager/rtpjitterbuffer.c @@ -100,16 +100,6 @@ rtp_jitter_buffer_new (void) } void -rtp_jitter_buffer_set_tail_changed (RTPJitterBuffer * jbuf, RTPTailChanged func, - gpointer user_data) -{ - g_return_if_fail (jbuf != NULL); - - jbuf->tail_changed = func; - jbuf->user_data = user_data; -} - -void rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer * jbuf, gint clock_rate) { g_return_if_fail (jbuf != NULL); @@ -374,6 +364,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 + * @tail: TRUE when the tail element changed. * * Inserts @buf into the packet queue of @jbuf. The sequence number of the * packet will be used to sort the packets. This function takes ownerhip of @@ -383,7 +374,7 @@ compare_seqnum (GstBuffer * a, GstBuffer * b, RTPJitterBuffer * jbuf) */ gboolean rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, GstBuffer * buf, - GstClockTime time) + GstClockTime time, gboolean * tail) { GList *list; gint func_ret = 1; @@ -412,13 +403,12 @@ rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, GstBuffer * buf, if (list) g_queue_insert_before (jbuf->packets, list, buf); - else { + else g_queue_push_tail (jbuf->packets, buf); - /* tail buffer changed, signal callback */ - if (jbuf->tail_changed) - jbuf->tail_changed (jbuf, jbuf->user_data); - } + /* tail was changed when we did not find a previous packet */ + if (tail) + *tail = (list == NULL); return TRUE; } |