From: <wt...@fr...> - 2005-09-26 17:46:46
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wtay Date: Mon Sep 26 2005 10:46:39 PDT Log message: * gst/gstbin.c: (gst_bin_change_state): Make state change function use 3 queues again, we were adding elements in the wrong order. * gst/gstghostpad.c: (gst_ghost_pad_do_unlink): Some debug info, * gst/gstpad.c: (gst_pad_dispose): Added some debug info first. Modified files: . : ChangeLog gst : gstbin.c gstghostpad.c gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1571&r2=1.1572 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbin.c.diff?r1=1.263&r2=1.264 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstghostpad.c.diff?r1=1.18&r2=1.19 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.442&r2=1.443 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1571 retrieving revision 1.1572 diff -u -d -r1.1571 -r1.1572 --- ChangeLog 26 Sep 2005 17:40:39 -0000 1.1571 +++ ChangeLog 26 Sep 2005 17:46:26 -0000 1.1572 @@ -1,3 +1,15 @@ +2005-09-26 Wim Taymans <wi...@fl...> + + * gst/gstbin.c: (gst_bin_change_state): + Make state change function use 3 queues again, we were + adding elements in the wrong order. + * gst/gstghostpad.c: (gst_ghost_pad_do_unlink): + Some debug info, + * gst/gstpad.c: (gst_pad_dispose): + Added some debug info first. 2005-09-26 Tim-Philipp Müller <tim at centricular dot net> * docs/design/draft-push-pull.txt: Index: gstbin.c RCS file: /cvs/gstreamer/gstreamer/gst/gstbin.c,v retrieving revision 1.263 retrieving revision 1.264 diff -u -d -r1.263 -r1.264 --- gstbin.c 24 Sep 2005 14:14:03 -0000 1.263 +++ gstbin.c 26 Sep 2005 17:46:27 -0000 1.264 @@ -1128,12 +1128,6 @@ return ret; } -static void -append_child (gpointer child, GQueue * queue) -{ - g_queue_push_tail (queue, child); -} - /** * gst_bin_iterate_state_order: * @bin: #Gstbin to iterate on @@ -1290,12 +1284,8 @@ * bin. We operate on the snapshot taken above. Applications * should serialize their add/remove and set_state. */ - /* now change state for semi sink elements first so add them in - * front of the other elements */ - g_queue_foreach (temp, (GFunc) append_child, semi_queue); - clear_queue (temp, FALSE); - /* if we don't have real sinks, we continue with the other elements */ + /* if we don't have real sinks, we continue with the other elements, there + * has to be at least one element in the semi queue. */ if (g_queue_is_empty (elem_queue) && !g_queue_is_empty (semi_queue)) { GQueue *q = elem_queue; @@ -1315,6 +1305,7 @@ qelement = g_queue_pop_head (elem_queue); /* we don't need any duplicates in the other queue anymore */ remove_all_from_queue (semi_queue, qelement, TRUE); + remove_all_from_queue (temp, qelement, TRUE); /* queue all elements connected to the sinkpads of this element */ GST_LOCK (qelement); @@ -1347,10 +1338,11 @@ /* make sure we don't have duplicates */ remove_all_from_queue (semi_queue, peer_parent, TRUE); remove_all_from_queue (elem_queue, peer_parent, TRUE); + remove_all_from_queue (temp, peer_parent, TRUE); /* was reffed before pushing on the queue by the * gst_object_get_parent() call we used to get the element. */ - g_queue_push_head (elem_queue, peer_parent); + g_queue_push_tail (elem_queue, peer_parent); /* so that we don't unref it */ peer_parent = NULL; } else { @@ -1437,8 +1429,14 @@ GST_DEBUG ("sinks and upstream elements exhausted"); non_sink = g_queue_pop_head (semi_queue); if (non_sink) { - GST_DEBUG ("found lefover non-sink %s", GST_OBJECT_NAME (non_sink)); + GST_DEBUG ("found lefover semi-sink %s", GST_OBJECT_NAME (non_sink)); g_queue_push_tail (elem_queue, non_sink); + } else { + non_sink = g_queue_pop_head (temp); + if (non_sink) { + GST_DEBUG ("found lefover non-sink %s", GST_OBJECT_NAME (non_sink)); + g_queue_push_tail (elem_queue, non_sink); + } } } } @@ -1462,6 +1460,7 @@ * had an error. */ clear_queue (elem_queue, TRUE); clear_queue (semi_queue, TRUE); + clear_queue (temp, TRUE); g_queue_free (elem_queue); g_queue_free (semi_queue); g_queue_free (temp); Index: gstghostpad.c RCS file: /cvs/gstreamer/gstreamer/gst/gstghostpad.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- gstghostpad.c 2 Sep 2005 16:17:23 -0000 1.18 +++ gstghostpad.c 26 Sep 2005 17:46:27 -0000 1.19 @@ -604,6 +604,8 @@ g_return_if_fail (target != NULL); + GST_DEBUG_OBJECT (pad, "unlinking ghostpad"); if (target->unlinkfunc) target->unlinkfunc (target); Index: gstpad.c RCS file: /cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.442 retrieving revision 1.443 diff -u -d -r1.442 -r1.443 --- gstpad.c 25 Sep 2005 11:19:22 -0000 1.442 +++ gstpad.c 26 Sep 2005 17:46:27 -0000 1.443 @@ -312,11 +312,11 @@ /* FIXME: what about if g_object_dispose is explicitly called on the pad? Is that legal? otherwise we could assert GST_OBJECT_PARENT (pad) == NULL as well... */ - g_assert (GST_PAD_PEER (pad) == NULL); GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "dispose %s:%s", GST_DEBUG_PAD_NAME (pad)); + g_assert (GST_PAD_PEER (pad) == NULL); /* clear the caps */ gst_caps_replace (&GST_PAD_CAPS (pad), NULL); |