mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
gst/playback/gstqueue2.c: Fix queue negotiation. See #486758.
Original commit message from CVS: * gst/playback/gstqueue2.c: (gst_queue_init), (gst_queue_push_one): Fix queue negotiation. See #486758.
This commit is contained in:
parent
73be0c35c0
commit
7d6d46fea6
1 changed files with 10 additions and 12 deletions
|
@ -319,7 +319,6 @@ static void gst_queue_get_property (GObject * object,
|
||||||
static GstFlowReturn gst_queue_chain (GstPad * pad, GstBuffer * buffer);
|
static GstFlowReturn gst_queue_chain (GstPad * pad, GstBuffer * buffer);
|
||||||
static GstFlowReturn gst_queue_bufferalloc (GstPad * pad, guint64 offset,
|
static GstFlowReturn gst_queue_bufferalloc (GstPad * pad, guint64 offset,
|
||||||
guint size, GstCaps * caps, GstBuffer ** buf);
|
guint size, GstCaps * caps, GstBuffer ** buf);
|
||||||
static gboolean gst_queue_acceptcaps (GstPad * pad, GstCaps * caps);
|
|
||||||
static GstFlowReturn gst_queue_push_one (GstQueue * queue);
|
static GstFlowReturn gst_queue_push_one (GstQueue * queue);
|
||||||
static void gst_queue_loop (GstPad * pad);
|
static void gst_queue_loop (GstPad * pad);
|
||||||
|
|
||||||
|
@ -445,8 +444,6 @@ gst_queue_init (GstQueue * queue, GstQueueClass * g_class)
|
||||||
GST_DEBUG_FUNCPTR (gst_queue_get_range));
|
GST_DEBUG_FUNCPTR (gst_queue_get_range));
|
||||||
gst_pad_set_checkgetrange_function (queue->srcpad,
|
gst_pad_set_checkgetrange_function (queue->srcpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_queue_src_checkgetrange_function));
|
GST_DEBUG_FUNCPTR (gst_queue_src_checkgetrange_function));
|
||||||
gst_pad_set_acceptcaps_function (queue->srcpad,
|
|
||||||
GST_DEBUG_FUNCPTR (gst_queue_acceptcaps));
|
|
||||||
gst_pad_set_getcaps_function (queue->srcpad,
|
gst_pad_set_getcaps_function (queue->srcpad,
|
||||||
GST_DEBUG_FUNCPTR (gst_queue_getcaps));
|
GST_DEBUG_FUNCPTR (gst_queue_getcaps));
|
||||||
gst_pad_set_event_function (queue->srcpad,
|
gst_pad_set_event_function (queue->srcpad,
|
||||||
|
@ -547,14 +544,6 @@ gst_queue_bufferalloc (GstPad * pad, guint64 offset, guint size, GstCaps * caps,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gst_queue_acceptcaps (GstPad * pad, GstCaps * caps)
|
|
||||||
{
|
|
||||||
/* The only time our acceptcaps method should be called is on the srcpad
|
|
||||||
* when we push a buffer, in which case we always accepted those caps */
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* calculate the diff between running time on the sink and src of the queue.
|
/* calculate the diff between running time on the sink and src of the queue.
|
||||||
* This is the total amount of time in the queue. */
|
* This is the total amount of time in the queue. */
|
||||||
static void
|
static void
|
||||||
|
@ -1359,10 +1348,19 @@ gst_queue_push_one (GstQueue * queue)
|
||||||
|
|
||||||
next:
|
next:
|
||||||
if (GST_IS_BUFFER (data)) {
|
if (GST_IS_BUFFER (data)) {
|
||||||
GstBuffer *buffer = GST_BUFFER_CAST (data);
|
GstBuffer *buffer;
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
|
buffer = GST_BUFFER_CAST (data);
|
||||||
|
caps = GST_BUFFER_CAPS (buffer);
|
||||||
|
|
||||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||||
|
|
||||||
|
/* set caps before pushing the buffer so that core does not try to do
|
||||||
|
* something fancy to check if this is possible. */
|
||||||
|
if (caps && caps != GST_PAD_CAPS (queue->srcpad))
|
||||||
|
gst_pad_set_caps (queue->srcpad, caps);
|
||||||
|
|
||||||
result = gst_pad_push (queue->srcpad, buffer);
|
result = gst_pad_push (queue->srcpad, buffer);
|
||||||
|
|
||||||
/* need to check for srcresult here as well */
|
/* need to check for srcresult here as well */
|
||||||
|
|
Loading…
Reference in a new issue