diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-04-30 13:41:30 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-04-30 13:41:30 +0000 |
commit | 5171199836b057eef7d98542268c5918fdaa47cd (patch) | |
tree | 32e7ccbfd16994fcaa1f3e09a6d4c711892e5251 /gst/rtpmanager/async_jitter_queue.c | |
parent | f4508d302c4edb5f51374815c360b4bcc6b9f43d (diff) | |
download | gst-plugins-bad-5171199836b057eef7d98542268c5918fdaa47cd.tar.gz gst-plugins-bad-5171199836b057eef7d98542268c5918fdaa47cd.tar.bz2 gst-plugins-bad-5171199836b057eef7d98542268c5918fdaa47cd.zip |
gst/rtpmanager/async_jitter_queue.c: Fix the case where the buffer underruns and does not block.
Original commit message from CVS:
* gst/rtpmanager/async_jitter_queue.c: (signal_waiting_threads),
(async_jitter_queue_pop_intern_unlocked):
Fix the case where the buffer underruns and does not block.
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_base_init),
(create_recv_rtcp), (create_send_rtp), (create_rtcp),
(gst_rtp_bin_request_new_pad):
Rename RTCP send pad, like in the session manager.
Allow getting an RTCP pad for receiving even if we don't receive RTP.
fix handling of send_rtp_src pad.
* gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_chain):
When no pt map could be found, fall back to the sinkpad caps.
* gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_process_rtp),
(gst_rtp_session_send_rtp), (create_recv_rtp_sink),
(create_recv_rtcp_sink), (create_send_rtp_sink),
(create_send_rtcp_src):
Fix pad names.
* gst/rtpmanager/rtpsession.c: (source_push_rtp),
(rtp_session_create_source), (rtp_session_process_sr),
(rtp_session_send_rtp), (session_start_rtcp):
* gst/rtpmanager/rtpsession.h:
Unlock session when performing a callback.
Add callbacks for the internal session object.
Fix sending of RTP packets.
first attempt at adding NTP times in the SR packets.
Small debug and doc improvements.
* gst/rtpmanager/rtpsource.c: (rtp_source_send_rtp):
Update stats for SR reports.
Diffstat (limited to 'gst/rtpmanager/async_jitter_queue.c')
-rw-r--r-- | gst/rtpmanager/async_jitter_queue.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gst/rtpmanager/async_jitter_queue.c b/gst/rtpmanager/async_jitter_queue.c index 22a8ed0e..81ba381e 100644 --- a/gst/rtpmanager/async_jitter_queue.c +++ b/gst/rtpmanager/async_jitter_queue.c @@ -100,6 +100,7 @@ signal_waiting_threads (AsyncJitterQueue * queue) { if (async_jitter_queue_length_ts_units_unlocked (queue) >= queue->high_threshold * queue->max_queue_length) { + GST_DEBUG ("stop buffering"); queue->buffering = FALSE; } @@ -473,6 +474,7 @@ async_jitter_queue_pop_intern_unlocked (AsyncJitterQueue * queue) { gpointer retval; GstBuffer *tail_buffer = NULL; + guint tsunits; if (queue->pop_flushing) return NULL; @@ -485,20 +487,27 @@ async_jitter_queue_pop_intern_unlocked (AsyncJitterQueue * queue) return NULL; } - if (async_jitter_queue_length_ts_units_unlocked (queue) <= - queue->low_threshold * queue->max_queue_length + + tsunits = async_jitter_queue_length_ts_units_unlocked (queue); + + GST_DEBUG ("tsunits %u, pops: %u, limit %d", tsunits, queue->pops_remaining, + queue->low_threshold * queue->max_queue_length); + + if (tsunits <= queue->low_threshold * queue->max_queue_length && queue->pops_remaining == 0) { if (!queue->buffering) { + GST_DEBUG ("start buffering"); queue->buffering = TRUE; queue->pops_remaining = queue->queue->length; - } else { - while (!g_queue_peek_tail (queue->queue) || queue->pop_blocking) { - queue->waiting_threads++; - g_cond_wait (queue->cond, queue->mutex); - queue->waiting_threads--; - if (queue->pop_flushing) - return NULL; - } + } + + GST_DEBUG ("wait for data"); + while (!g_queue_peek_tail (queue->queue) || queue->pop_blocking) { + queue->waiting_threads++; + g_cond_wait (queue->cond, queue->mutex); + queue->waiting_threads--; + if (queue->pop_flushing) + return NULL; } } |