Mostly debugging changes. What's in CVS seems to work rather well, actually.

Original commit message from CVS:
Mostly debugging changes.  What's in CVS seems to work rather well, actually.

Next is the work on task 23098...
This commit is contained in:
Erik Walthinsen 2000-12-08 23:38:12 +00:00
parent 1aed13ae6b
commit 0f9d972b3d
2 changed files with 14 additions and 5 deletions

View file

@ -603,6 +603,7 @@ gst_bin_connection_wrapper (int argc,char *argv[])
DEBUG_ENTER("(%d,\"%s\")",argc,name); DEBUG_ENTER("(%d,\"%s\")",argc,name);
do { do {
DEBUG("Connection checking pads\n");
pads = element->pads; pads = element->pads;
while (pads) { while (pads) {
pad = GST_PAD (pads->data); pad = GST_PAD (pads->data);
@ -613,6 +614,8 @@ gst_bin_connection_wrapper (int argc,char *argv[])
} }
pads = g_list_next(pads); pads = g_list_next(pads);
} }
DEBUG("Connection done checking pads, checking COTHREAD_STOPPING on \"%s\"(%p)\n",
gst_element_get_name(element),element);
} 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);
@ -683,6 +686,7 @@ gst_bin_create_plan_func (GstBin *bin)
gst_element_get_name (GST_ELEMENT (bin))); gst_element_get_name (GST_ELEMENT (bin)));
bin->need_cothreads = TRUE; bin->need_cothreads = TRUE;
DEBUG("NEED COTHREADS, it's \"%s\"'s fault\n",gst_element_get_name(element));
break; break;
} }
// if it's a complex element, use cothreads // if it's a complex element, use cothreads
@ -692,6 +696,7 @@ gst_bin_create_plan_func (GstBin *bin)
gst_element_get_name (GST_ELEMENT (bin))); gst_element_get_name (GST_ELEMENT (bin)));
bin->need_cothreads = TRUE; bin->need_cothreads = TRUE;
DEBUG("NEED COTHREADS, it's \"%s\"'s fault\n",gst_element_get_name(element));
break; break;
} }
// if it has more than one input pad, use cothreads // if it has more than one input pad, use cothreads
@ -709,6 +714,7 @@ gst_bin_create_plan_func (GstBin *bin)
gst_element_get_name (GST_ELEMENT (bin))); gst_element_get_name (GST_ELEMENT (bin)));
bin->need_cothreads = TRUE; bin->need_cothreads = TRUE;
DEBUG("NEED COTHREADS, it's \"%s\"'s fault\n",gst_element_get_name(element));
break; break;
} }
elements = g_list_next (elements); elements = g_list_next (elements);
@ -725,8 +731,6 @@ gst_bin_create_plan_func (GstBin *bin)
bin->numentries = 0; bin->numentries = 0;
if (bin->need_cothreads) { if (bin->need_cothreads) {
DEBUG("NEED COTHREADS\n");
// first create thread context // first create thread context
if (bin->threadcontext == NULL) { if (bin->threadcontext == NULL) {
bin->threadcontext = cothread_init (); bin->threadcontext = cothread_init ();
@ -904,8 +908,11 @@ gst_bin_iterate_func (GstBin *bin)
// all we really have to do is switch to the first child // all we really have to do is switch to the first child
// FIXME this should be lots more intelligent about where to start // FIXME this should be lots more intelligent about where to start
GST_FLAG_SET (GST_ELEMENT (bin->children->data), GST_ELEMENT_COTHREAD_STOPPING); entry = GST_ELEMENT (bin->children->data);
cothread_switch (GST_ELEMENT (bin->children->data)->threadstate); GST_FLAG_SET (entry, GST_ELEMENT_COTHREAD_STOPPING);
DEBUG("set COTHREAD_STOPPING flag on \"%s\"(%p)\n",
gst_element_get_name(entry),entry);
cothread_switch (entry->threadstate);
} else { } else {
if (bin->numentries <= 0) { if (bin->numentries <= 0) {

View file

@ -208,6 +208,8 @@ gst_thread_change_state (GstElement *element)
gint pending; gint pending;
g_return_val_if_fail (GST_IS_THREAD(element), FALSE); g_return_val_if_fail (GST_IS_THREAD(element), FALSE);
DEBUG_ENTER("(\"%s\")",gst_element_get_name(element));
thread = GST_THREAD (element); thread = GST_THREAD (element);
gst_info("gstthread: thread \"%s\" change state %d\n", gst_info("gstthread: thread \"%s\" change state %d\n",