mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 17:52:29 +00:00
change the chainwrapper to allow removing pads during iterations
Original commit message from CVS: change the chainwrapper to allow removing pads during iterations
This commit is contained in:
parent
b90165ef48
commit
cb853c1bcf
1 changed files with 33 additions and 24 deletions
|
@ -314,6 +314,7 @@ gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv)
|
||||||
static int
|
static int
|
||||||
gst_basic_scheduler_chain_wrapper (int argc, char **argv)
|
gst_basic_scheduler_chain_wrapper (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
GSList *already_iterated = NULL;
|
||||||
GstElement *element = GST_ELEMENT_CAST (argv);
|
GstElement *element = GST_ELEMENT_CAST (argv);
|
||||||
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
|
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
|
||||||
|
|
||||||
|
@ -323,20 +324,22 @@ gst_basic_scheduler_chain_wrapper (int argc, char **argv)
|
||||||
|
|
||||||
gst_object_ref (GST_OBJECT (element));
|
gst_object_ref (GST_OBJECT (element));
|
||||||
do {
|
do {
|
||||||
GList *pads = element->pads;
|
GList *pads;
|
||||||
|
do {
|
||||||
|
pads = element->pads;
|
||||||
|
|
||||||
while (pads) {
|
while (pads) {
|
||||||
GstPad *pad = GST_PAD (pads->data);
|
GstPad *pad = GST_PAD (pads->data);
|
||||||
GstRealPad *realpad;
|
GstRealPad *realpad;
|
||||||
|
|
||||||
pads = g_list_next (pads);
|
|
||||||
if (!GST_IS_REAL_PAD (pad))
|
if (!GST_IS_REAL_PAD (pad))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
realpad = GST_REAL_PAD_CAST (pad);
|
realpad = GST_REAL_PAD (pad);
|
||||||
|
|
||||||
if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SINK &&
|
if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SINK &&
|
||||||
GST_PAD_IS_LINKED (realpad)) {
|
GST_PAD_IS_LINKED (realpad) &&
|
||||||
|
g_slist_find (already_iterated, pad) == NULL) {
|
||||||
GstData *data;
|
GstData *data;
|
||||||
|
|
||||||
GST_CAT_DEBUG (debug_dataflow, "pulling data from %s:%s", name,
|
GST_CAT_DEBUG (debug_dataflow, "pulling data from %s:%s", name,
|
||||||
|
@ -354,8 +357,14 @@ gst_basic_scheduler_chain_wrapper (int argc, char **argv)
|
||||||
"calling chain function of element %s done", name);
|
"calling chain function of element %s done", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
already_iterated = g_slist_prepend (already_iterated, pad);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
pads = g_list_next (pads);
|
||||||
}
|
}
|
||||||
|
} while (pads != NULL);
|
||||||
|
g_slist_free (already_iterated);
|
||||||
|
already_iterated = NULL;
|
||||||
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
|
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
|
||||||
|
|
||||||
GST_FLAG_UNSET (element, GST_ELEMENT_COTHREAD_STOPPING);
|
GST_FLAG_UNSET (element, GST_ELEMENT_COTHREAD_STOPPING);
|
||||||
|
|
Loading…
Reference in a new issue