mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
plugins/elements/gstqueue.*: When dropping buffers in leaky modes, mark next buffers we sent as
Original commit message from CVS: * plugins/elements/gstqueue.c: * plugins/elements/gstqueue.h: When dropping buffers in leaky modes, mark next buffers we sent as DISCONT.
This commit is contained in:
parent
62aa68ade5
commit
0b9cfcfbcd
3 changed files with 25 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2008-02-20 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* plugins/elements/gstqueue.c:
|
||||
* plugins/elements/gstqueue.h:
|
||||
When dropping buffers in leaky modes, mark next buffers we sent as
|
||||
DISCONT.
|
||||
|
||||
2008-02-20 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* plugins/elements/gstfilesrc.c: (gst_file_src_map_region):
|
||||
|
|
|
@ -398,6 +398,7 @@ gst_queue_init (GstQueue * queue, GstQueueClass * g_class)
|
|||
GST_QUEUE_CLEAR_LEVEL (queue->orig_min_threshold);
|
||||
gst_segment_init (&queue->sink_segment, GST_FORMAT_TIME);
|
||||
gst_segment_init (&queue->src_segment, GST_FORMAT_TIME);
|
||||
queue->head_needs_discont = queue->tail_needs_discont = FALSE;
|
||||
|
||||
queue->leaky = GST_QUEUE_NO_LEAK;
|
||||
queue->srcresult = GST_FLOW_WRONG_STATE;
|
||||
|
@ -601,6 +602,7 @@ gst_queue_locked_flush (GstQueue * queue)
|
|||
queue->min_threshold.time = queue->orig_min_threshold.time;
|
||||
gst_segment_init (&queue->sink_segment, GST_FORMAT_TIME);
|
||||
gst_segment_init (&queue->src_segment, GST_FORMAT_TIME);
|
||||
queue->head_needs_discont = queue->tail_needs_discont = FALSE;
|
||||
|
||||
/* we deleted a lot of something */
|
||||
GST_QUEUE_SIGNAL_DEL (queue);
|
||||
|
@ -865,6 +867,8 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|||
/* how are we going to make space for this buffer? */
|
||||
switch (queue->leaky) {
|
||||
case GST_QUEUE_LEAK_UPSTREAM:
|
||||
/* next buffer needs to get a DISCONT flag */
|
||||
queue->tail_needs_discont = TRUE;
|
||||
/* leak current buffer */
|
||||
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
||||
"queue is full, leaking buffer on upstream end");
|
||||
|
@ -886,6 +890,8 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|||
"queue is full, leaking item %p on downstream end", leak);
|
||||
gst_buffer_unref (leak);
|
||||
} while (gst_queue_is_filled (queue));
|
||||
/* last buffer needs to get a DISCONT flag */
|
||||
queue->head_needs_discont = TRUE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -912,6 +918,11 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
}
|
||||
|
||||
if (queue->tail_needs_discont) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
|
||||
queue->tail_needs_discont = FALSE;
|
||||
}
|
||||
|
||||
/* put buffer in queue now */
|
||||
gst_queue_locked_enqueue (queue, buffer);
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -979,6 +990,11 @@ next:
|
|||
buffer = GST_BUFFER_CAST (data);
|
||||
caps = GST_BUFFER_CAPS (buffer);
|
||||
|
||||
if (queue->head_needs_discont) {
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
|
||||
queue->head_needs_discont = FALSE;
|
||||
}
|
||||
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
/* set the right caps on the pad now. We do this before pushing the buffer
|
||||
* because the pad_push call will check (using acceptcaps) if the buffer can
|
||||
|
|
|
@ -105,6 +105,8 @@ struct _GstQueue {
|
|||
GMutex *qlock; /* lock for queue (vs object lock) */
|
||||
GCond *item_add; /* signals buffers now available for reading */
|
||||
GCond *item_del; /* signals space now available for writing */
|
||||
|
||||
gboolean head_needs_discont, tail_needs_discont;
|
||||
};
|
||||
|
||||
struct _GstQueueClass {
|
||||
|
|
Loading…
Reference in a new issue