mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
Store the element in the cothread private field.
Original commit message from CVS: Store the element in the cothread private field. If we remove the current entry in the cothread chain, make sure another cothread is marked as COTHREAD_STOPPING.
This commit is contained in:
parent
929b4bd3d1
commit
7835b75f0a
1 changed files with 14 additions and 0 deletions
|
@ -578,6 +578,7 @@ gst_basic_scheduler_cothreaded_chain (GstBin * bin, GstSchedulerChain * chain)
|
||||||
if (wrapper_function != NULL) {
|
if (wrapper_function != NULL) {
|
||||||
if (GST_ELEMENT_THREADSTATE (element) == NULL) {
|
if (GST_ELEMENT_THREADSTATE (element) == NULL) {
|
||||||
GST_ELEMENT_THREADSTATE (element) = cothread_create (GST_BIN_THREADCONTEXT (bin));
|
GST_ELEMENT_THREADSTATE (element) = cothread_create (GST_BIN_THREADCONTEXT (bin));
|
||||||
|
cothread_set_private (GST_ELEMENT_THREADSTATE (element), element);
|
||||||
if (GST_ELEMENT_THREADSTATE (element) == NULL) {
|
if (GST_ELEMENT_THREADSTATE (element) == NULL) {
|
||||||
gst_element_error (element, "could not create cothread for \"%s\"",
|
gst_element_error (element, "could not create cothread for \"%s\"",
|
||||||
GST_ELEMENT_NAME (element), NULL);
|
GST_ELEMENT_NAME (element), NULL);
|
||||||
|
@ -1004,6 +1005,19 @@ gst_basic_scheduler_remove_element (GstScheduler * sched, GstElement * element)
|
||||||
/* find what chain the element is in */
|
/* find what chain the element is in */
|
||||||
chain = gst_basic_scheduler_find_chain (bsched, element);
|
chain = gst_basic_scheduler_find_chain (bsched, element);
|
||||||
|
|
||||||
|
if (GST_ELEMENT_IS_COTHREAD_STOPPING (element)) {
|
||||||
|
GstElement *entry = GST_ELEMENT (cothread_get_private (cothread_current ()));
|
||||||
|
|
||||||
|
if (entry == element) {
|
||||||
|
g_warning ("removing currently running element! %s", GST_ELEMENT_NAME (entry));
|
||||||
|
}
|
||||||
|
else if (entry) {
|
||||||
|
GST_INFO (GST_CAT_SCHEDULING, "moving stopping to element \"%s\"",
|
||||||
|
GST_ELEMENT_NAME (entry));
|
||||||
|
GST_FLAG_SET (entry, GST_ELEMENT_COTHREAD_STOPPING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* remove it from its chain */
|
/* remove it from its chain */
|
||||||
gst_basic_scheduler_chain_remove_element (chain, element);
|
gst_basic_scheduler_chain_remove_element (chain, element);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue