/**
* gst_proyx_pad_iterate_internal_links_default:
* @pad: the #GstPad to get the internal links of.
+ * @parent: the parent of @pad or NULL
*
* Invoke the default iterate internal links function of the proxy pad.
*
* Since: 0.10.36
*/
GstIterator *
-gst_proxy_pad_iterate_internal_links_default (GstPad * pad)
+gst_proxy_pad_iterate_internal_links_default (GstPad * pad, GstObject * parent)
{
GstIterator *res = NULL;
GstPad *internal;
gboolean gst_proxy_pad_event_default (GstPad *pad, GstEvent *event);
gboolean gst_proxy_pad_query_default (GstPad *pad, GstObject *parent,
GstQuery *query);
-GstIterator* gst_proxy_pad_iterate_internal_links_default (GstPad *pad);
+GstIterator* gst_proxy_pad_iterate_internal_links_default (GstPad *pad, GstObject *parent);
GstFlowReturn gst_proxy_pad_chain_default (GstPad *pad, GstBuffer *buffer);
GstFlowReturn gst_proxy_pad_chain_list_default (GstPad *pad, GstBufferList *list);
GstFlowReturn gst_proxy_pad_getrange_default (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer);
/**
* gst_pad_iterate_internal_links_default:
* @pad: the #GstPad to get the internal links of.
+ * @parent: the parent of @pad or NULL
*
* Iterate the list of pads to which the given pad is linked to inside of
* the parent element.
* Since: 0.10.21
*/
GstIterator *
-gst_pad_iterate_internal_links_default (GstPad * pad)
+gst_pad_iterate_internal_links_default (GstPad * pad, GstObject * parent)
{
GstIterator *res;
GList **padlist;
guint32 *cookie;
GMutex *lock;
gpointer owner;
+ GstElement *eparent;
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
- {
- GstElement *parent;
-
+ if (parent != NULL && GST_IS_ELEMENT (parent)) {
+ eparent = GST_ELEMENT_CAST (gst_object_ref (parent));
+ } else {
GST_OBJECT_LOCK (pad);
- parent = GST_PAD_PARENT (pad);
- if (!parent || !GST_IS_ELEMENT (parent))
+ eparent = GST_PAD_PARENT (pad);
+ if (!eparent || !GST_IS_ELEMENT (eparent))
goto no_parent;
- gst_object_ref (parent);
+ gst_object_ref (eparent);
GST_OBJECT_UNLOCK (pad);
+ }
- if (pad->direction == GST_PAD_SRC)
- padlist = &parent->sinkpads;
- else
- padlist = &parent->srcpads;
+ if (pad->direction == GST_PAD_SRC)
+ padlist = &eparent->sinkpads;
+ else
+ padlist = &eparent->srcpads;
- GST_DEBUG_OBJECT (pad, "Making iterator");
+ GST_DEBUG_OBJECT (pad, "Making iterator");
- cookie = &parent->pads_cookie;
- owner = parent;
- lock = GST_OBJECT_GET_LOCK (parent);
- }
+ cookie = &eparent->pads_cookie;
+ owner = eparent;
+ lock = GST_OBJECT_GET_LOCK (eparent);
res = gst_iterator_new_list (GST_TYPE_PAD,
lock, cookie, padlist, (GObject *) owner, NULL);
GST_OBJECT_UNLOCK (pad);
if (GST_PAD_ITERINTLINKFUNC (pad))
- res = GST_PAD_ITERINTLINKFUNC (pad) (pad);
+ res = GST_PAD_ITERINTLINKFUNC (pad) (pad, parent);
RELEASE_PARENT (parent);
/**
* GstPadIterIntLinkFunction:
* @pad: The #GstPad to query.
+ * @parent: the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT flag is set,
+ * @parent is guaranteed to be not-NULL and remain valid during the
+ * execution of this function.
*
* The signature of the internal pad link iterator function.
*
*
* Since 0.10.21
*/
-typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad);
+typedef GstIterator* (*GstPadIterIntLinkFunction) (GstPad *pad, GstObject *parent);
/* generic query function */
/**
void gst_pad_set_iterate_internal_links_function (GstPad * pad,
GstPadIterIntLinkFunction iterintlink);
GstIterator * gst_pad_iterate_internal_links (GstPad * pad);
-GstIterator * gst_pad_iterate_internal_links_default (GstPad * pad);
+GstIterator * gst_pad_iterate_internal_links_default (GstPad * pad, GstObject *parent);
/* generic query function */
static gboolean gst_selector_pad_event (GstPad * pad, GstEvent * event);
static gboolean gst_selector_pad_query (GstPad * pad, GstObject * parent,
GstQuery * query);
-static GstIterator *gst_selector_pad_iterate_linked_pads (GstPad * pad);
+static GstIterator *gst_selector_pad_iterate_linked_pads (GstPad * pad,
+ GstObject * parent);
static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstBuffer * buf);
G_DEFINE_TYPE (GstSelectorPad, gst_selector_pad, GST_TYPE_PAD);
/* strictly get the linked pad from the sinkpad. If the pad is active we return
* the srcpad else we return NULL */
static GstIterator *
-gst_selector_pad_iterate_linked_pads (GstPad * pad)
+gst_selector_pad_iterate_linked_pads (GstPad * pad, GstObject * parent)
{
GstInputSelector *sel;
GstPad *otherpad;
GstIterator *it = NULL;
GValue val = { 0, };
- sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
+ sel = GST_INPUT_SELECTOR (parent);
otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE);
if (otherpad) {
}
static GstIterator *
-gst_multi_queue_iterate_internal_links (GstPad * pad)
+gst_multi_queue_iterate_internal_links (GstPad * pad, GstObject * parent)
{
GstIterator *it = NULL;
GstPad *opad;
GstSingleQueue *squeue;
- GstMultiQueue *mq = GST_MULTI_QUEUE (GST_PAD_PARENT (pad));
+ GstMultiQueue *mq = GST_MULTI_QUEUE (parent);
GValue val = { 0, };
GST_MULTI_QUEUE_MUTEX_LOCK (mq);