docs/design/part-gstghostpad.txt: Small update.

Original commit message from CVS:
* docs/design/part-gstghostpad.txt:
Small update.

* gst/gstbin.c: (unlink_pads), (gst_bin_add_func),
(gst_bin_remove_func):
Unlinking pads while holding the bin LOCK is not a good
idea.

* gst/gstpad.c: (gst_pad_class_init),
(gst_pad_link_check_hierarchy), (gst_pad_get_caps_unlocked),
(gst_pad_accept_caps), (gst_pad_set_caps), (gst_pad_send_event):
No prob setting template after creating the pad.
This commit is contained in:
Wim Taymans 2005-07-29 19:19:29 +00:00
parent 9b1b3593e0
commit 49de56dd1f
4 changed files with 28 additions and 14 deletions

View file

@ -1,3 +1,18 @@
2005-07-29 Wim Taymans <wim@fluendo.com>
* docs/design/part-gstghostpad.txt:
Small update.
* gst/gstbin.c: (unlink_pads), (gst_bin_add_func),
(gst_bin_remove_func):
Unlinking pads while holding the bin LOCK is not a good
idea.
* gst/gstpad.c: (gst_pad_class_init),
(gst_pad_link_check_hierarchy), (gst_pad_get_caps_unlocked),
(gst_pad_accept_caps), (gst_pad_set_caps), (gst_pad_send_event):
No prob setting template after creating the pad.
2005-07-29 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gstbus.c: (gst_bus_set_flushing), (gst_bus_pop),

View file

@ -153,7 +153,7 @@ Ghostpads
a) new GstProxyPad Y is created
b) Y direction is same as peer
c) Y target is set to peer
d) X internal pad is set to Y
d) X internal pad is set to Y (X is parent of Y)
e) Y is activated in the same mode as X
f) core makes link from src to X
@ -196,7 +196,7 @@ Ghostpads
a) new GstProxyPad Y is created
b) Y direction is same as peer
c) Y target is set to peer
d) X internal pad is set to Y
d) X internal pad is set to Y (X is parent of Y)
e) link is made from Y to X target (sink)
f) Y is activated in the same mode as X
g) core makes link from src to X

View file

@ -388,11 +388,6 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
if (GST_FLAG_IS_SET (element, GST_ELEMENT_IS_SINK))
GST_FLAG_SET (bin, GST_ELEMENT_IS_SINK);
/* unlink all linked pads */
it = gst_element_iterate_pads (element);
gst_iterator_foreach (it, (GFunc) unlink_pads, element);
gst_iterator_free (it);
bin->children = g_list_prepend (bin->children, element);
bin->numchildren++;
bin->children_cookie++;
@ -406,6 +401,11 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
GST_UNLOCK (bin);
/* unlink all linked pads */
it = gst_element_iterate_pads (element);
gst_iterator_foreach (it, (GFunc) unlink_pads, element);
gst_iterator_free (it);
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, bin, "added element \"%s\"",
elem_name);
g_free (elem_name);
@ -506,11 +506,6 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
if (G_UNLIKELY (g_list_find (bin->children, element) == NULL))
goto not_in_bin;
/* unlink all linked pads */
it = gst_element_iterate_pads (element);
gst_iterator_foreach (it, (GFunc) unlink_pads, element);
gst_iterator_free (it);
/* now remove the element from the list of elements */
bin->children = g_list_remove (bin->children, element);
bin->numchildren--;
@ -528,13 +523,17 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
GST_FLAG_UNSET (bin, GST_ELEMENT_IS_SINK);
}
}
GST_UNLOCK (bin);
GST_CAT_INFO_OBJECT (GST_CAT_PARENTAGE, bin, "removed child \"%s\"",
elem_name);
g_free (elem_name);
/* unlink all linked pads */
it = gst_element_iterate_pads (element);
gst_iterator_foreach (it, (GFunc) unlink_pads, element);
gst_iterator_free (it);
gst_element_set_bus (element, NULL);
/* unlock any waiters for the state change. It is possible that

View file

@ -183,7 +183,7 @@ gst_pad_class_init (GstPadClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), PAD_PROP_TEMPLATE,
g_param_spec_object ("template", "Template",
"The GstPadTemplate of this pad", GST_TYPE_PAD_TEMPLATE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
G_PARAM_READWRITE));
#ifndef GST_DISABLE_LOADSAVE
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_pad_save_thyself);