summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6de84a3)
raw | patch | inline | side by side (parent: 6de84a3)
author | Wim Taymans <wim.taymans@gmail.com> | |
Wed, 28 Sep 2005 11:03:58 +0000 (11:03 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Wed, 28 Sep 2005 11:03:58 +0000 (11:03 +0000) |
Original commit message from CVS:
* gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
(update_outdegree), (find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state), (gst_bin_dispose):
Some documentation updates.
Clean up dispose handlers.
* gst/gstobject.c: (gst_object_ref), (gst_object_unref):
* gst/gstpad.c: (gst_pad_dispose):
Clean up dispose handler.
* gst/gstpipeline.c: (gst_pipeline_change_state):
Removed spurious UNLOCK.
* gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
(update_outdegree), (find_element), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
(gst_bin_iterate_sorted), (gst_bin_element_set_state),
(gst_bin_change_state), (gst_bin_dispose):
Some documentation updates.
Clean up dispose handlers.
* gst/gstobject.c: (gst_object_ref), (gst_object_unref):
* gst/gstpad.c: (gst_pad_dispose):
Clean up dispose handler.
* gst/gstpipeline.c: (gst_pipeline_change_state):
Removed spurious UNLOCK.
ChangeLog | patch | blob | history | |
gst/gstbin.c | patch | blob | history | |
gst/gstobject.c | patch | blob | history | |
gst/gstpad.c | patch | blob | history | |
gst/gstpipeline.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index ae5454342361544a9b965d110a2fc433a8a01b31..ef0132a1d49e0194b9e5a9468e906a302ca3770d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2005-09-28 Wim Taymans <wim@fluendo.com>
+
+ * gst/gstbin.c: (add_to_queue), (clear_queue), (reset_outdegree),
+ (update_outdegree), (find_element), (gst_bin_sort_iterator_next),
+ (gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free),
+ (gst_bin_iterate_sorted), (gst_bin_element_set_state),
+ (gst_bin_change_state), (gst_bin_dispose):
+ Some documentation updates.
+ Clean up dispose handlers.
+
+ * gst/gstobject.c: (gst_object_ref), (gst_object_unref):
+ * gst/gstpad.c: (gst_pad_dispose):
+ Clean up dispose handler.
+
+ * gst/gstpipeline.c: (gst_pipeline_change_state):
+ Removed spurious UNLOCK.
+
2005-09-27 Stefan Kost <ensonic@users.sf.net>
* docs/gst/gstreamer-sections.txt:
diff --git a/gst/gstbin.c b/gst/gstbin.c
index 4b0024894832ff8fb551c0d606f0e8b085bfaccc..9a47f33cdccfb529e45089ac1d82d31677f42de9 100644 (file)
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
/***********************************************
* Topologically sorted iterator
* see http://en.wikipedia.org/wiki/Topological_sorting
+ *
+ * For each element in the graph, an entry is kept in a HashTable
+ * with its number of srcpad connections (degree).
+ * We then change state of all elements without dependencies
+ * (degree 0) and decrement the degree of all elements connected
+ * on the sinkpads. When an element reaches degree 0, its state is
+ * changed next.
+ * When all elements are handled the algorithm stops.
*/
typedef struct _GstBinSortIterator
{
/* we don't fail on this one yet */
g_warning ("loop detected in the graph !!");
}
- /* best unhandled elements, scheduler as next element */
+ /* best unhandled element, schedule as next element */
GST_DEBUG ("queue empty, next best: %s", GST_ELEMENT_NAME (bit->best));
gst_object_ref (bit->best);
HASH_SET_DEGREE (bit, bit->best, -1);
while (bin->children) {
gst_bin_remove (bin, GST_ELEMENT (bin->children->data));
}
- GST_CAT_DEBUG_OBJECT (GST_CAT_REFCOUNTING, object, "dispose no children");
- g_assert (bin->children == NULL);
- g_assert (bin->numchildren == 0);
+ if (G_UNLIKELY (bin->children != NULL)) {
+ g_critical ("could not remove elements from bin %s",
+ GST_STR_NULL (GST_OBJECT_NAME (object)));
+ }
G_OBJECT_CLASS (parent_class)->dispose (object);
}
diff --git a/gst/gstobject.c b/gst/gstobject.c
index c4f9d304363cf22756c39c3f5224c1a371d96de5..1157755e05fa2490c02ab3fe6a6bfcd6a37c085d 100644 (file)
--- a/gst/gstobject.c
+++ b/gst/gstobject.c
g_atomic_int_inc (&((GstObject *) object)->refcount);
PATCH_REFCOUNT (object);
#else
- /* FIXME, not MT safe because glib is not MT safe */
g_object_ref (object);
#endif
PATCH_REFCOUNT (object);
}
#else
- /* FIXME, not MT safe because glib is not MT safe */
g_object_unref (object);
#endif
}
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 853b43aa46a912570159db61267e217e39c76233..86d5dc416618778010e5540f43ac0bb95c2d7b31 100644 (file)
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
{
GstPad *pad = GST_PAD (object);
- gst_pad_set_pad_template (pad, NULL);
- /* FIXME, we have links to many other things like caps
- * and the peer pad... */
-
- /* No linked pad can ever be disposed.
- * It has to have a parent to be linked
- * and a parent would hold a reference */
- /* 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... */
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "dispose %s:%s",
GST_DEBUG_PAD_NAME (pad));
- g_assert (GST_PAD_PEER (pad) == NULL);
+ /* we don't hold a ref to the peer so we can just set the
+ * peer to NULL. */
+ GST_PAD_PEER (pad) = NULL;
/* clear the caps */
gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
- if (GST_IS_ELEMENT (GST_OBJECT_PARENT (pad))) {
- GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "removing pad from element '%s'",
- GST_OBJECT_NAME (GST_OBJECT (GST_ELEMENT (GST_OBJECT_PARENT (pad)))));
-
- gst_element_remove_pad (GST_ELEMENT (GST_OBJECT_PARENT (pad)), pad);
- }
+ gst_pad_set_pad_template (pad, NULL);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
* @size: The length of the buffer
* @buffer: a pointer to hold the #GstBuffer.
*
- * Pulls a buffer from the peer pad. @pad must be linked.
+ * Pulls a buffer from the peer pad. @pad must be a linked
+ * sinkpad.
*
* Returns: a #GstFlowReturn from the peer pad.
*
diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c
index f45088822b438b6754d0607fced275ef0bcaa363..dea2475cba1e70a941970518ab67e0865e3b8eee 100644 (file)
--- a/gst/gstpipeline.c
+++ b/gst/gstpipeline.c
GST_TIME_ARGS (start_time), GST_TIME_ARGS (element->base_time));
GST_UNLOCK (element);
} else {
- GST_UNLOCK (element);
GST_DEBUG ("no clock, using base time of 0");
gst_element_set_base_time (element, 0);
}