mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
plugins/elements/gstqueue.c: Add and use a custom acceptcaps function instead of falling back to the potentially less...
Original commit message from CVS: * plugins/elements/gstqueue.c: (gst_queue_init), (gst_queue_acceptcaps): Add and use a custom acceptcaps function instead of falling back to the potentially less optimized default implementation.
This commit is contained in:
parent
20d11b6fe0
commit
66d6f67b02
2 changed files with 27 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2008-07-31 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||
|
||||
* plugins/elements/gstqueue.c: (gst_queue_init),
|
||||
(gst_queue_acceptcaps):
|
||||
Add and use a custom acceptcaps function instead of falling back to the
|
||||
potentially less optimized default implementation.
|
||||
|
||||
2008-07-29 Tim-Philipp Müller <tim.muller at collabora co uk>
|
||||
|
||||
* gst/gstpad.c: (gst_pad_alloc_buffer_full):
|
||||
|
|
|
@ -196,6 +196,7 @@ static gboolean gst_queue_handle_sink_event (GstPad * pad, GstEvent * event);
|
|||
static gboolean gst_queue_handle_src_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_queue_handle_src_query (GstPad * pad, GstQuery * query);
|
||||
|
||||
static gboolean gst_queue_acceptcaps (GstPad * pad, GstCaps * caps);
|
||||
static GstCaps *gst_queue_getcaps (GstPad * pad);
|
||||
static GstPadLinkReturn gst_queue_link_sink (GstPad * pad, GstPad * peer);
|
||||
static GstPadLinkReturn gst_queue_link_src (GstPad * pad, GstPad * peer);
|
||||
|
@ -374,6 +375,8 @@ gst_queue_init (GstQueue * queue, GstQueueClass * g_class)
|
|||
GST_DEBUG_FUNCPTR (gst_queue_link_sink));
|
||||
gst_pad_set_getcaps_function (queue->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_getcaps));
|
||||
gst_pad_set_acceptcaps_function (queue->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_acceptcaps));
|
||||
gst_pad_set_bufferalloc_function (queue->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_bufferalloc));
|
||||
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
|
||||
|
@ -384,6 +387,8 @@ gst_queue_init (GstQueue * queue, GstQueueClass * g_class)
|
|||
GST_DEBUG_FUNCPTR (gst_queue_src_activate_push));
|
||||
gst_pad_set_link_function (queue->srcpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_link_src));
|
||||
gst_pad_set_acceptcaps_function (queue->srcpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_acceptcaps));
|
||||
gst_pad_set_getcaps_function (queue->srcpad,
|
||||
GST_DEBUG_FUNCPTR (gst_queue_getcaps));
|
||||
gst_pad_set_event_function (queue->srcpad,
|
||||
|
@ -435,6 +440,21 @@ gst_queue_finalize (GObject * object)
|
|||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_queue_acceptcaps (GstPad * pad, GstCaps * caps)
|
||||
{
|
||||
gboolean result;
|
||||
GstQueue *queue;
|
||||
GstPad *otherpad;
|
||||
|
||||
queue = GST_QUEUE (GST_PAD_PARENT (pad));
|
||||
|
||||
otherpad = (pad == queue->srcpad ? queue->sinkpad : queue->srcpad);
|
||||
result = gst_pad_peer_accept_caps (otherpad, caps);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_queue_getcaps (GstPad * pad)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue