docs/design/part-gstghostpad.txt: Small update.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 29 Jul 2005 19:19:29 +0000 (19:19 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 29 Jul 2005 19:19:29 +0000 (19:19 +0000)
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.

ChangeLog
docs/design/part-gstghostpad.txt
gst/gstbin.c
gst/gstpad.c

index cfff567..be7771e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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),
index 2b23abc..757c79f 100644 (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
index 9ebfe64..4fa1c42 100644 (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
index ae9906f..9ebfbdc 100644 (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);