element: remove inactive pad g_warning in add_pad
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 20 Sep 2018 14:28:35 +0000 (16:28 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Thu, 27 Sep 2018 10:46:50 +0000 (12:46 +0200)
The documentation incorrectly used to state that the pads were
not automatically activated when added, whereas we actually do
that when appropriate.

Callers of gst_element_add_pad must not hold the object lock,
which implies that they cannot perform the same checks as
add_pad in a non-racy manner.

This updates the documentation, and removes the g_warning
that was output before performing automatic activation.

https://bugzilla.gnome.org/show_bug.cgi?id=797181

gst/gstelement.c

index 2ea49c0..4078fa7 100644 (file)
@@ -640,9 +640,8 @@ gst_element_get_index (GstElement * element)
  * Adds a pad (link point) to @element. @pad's parent will be set to @element;
  * see gst_object_set_parent() for refcounting information.
  *
- * Pads are not automatically activated so elements should perform the needed
- * steps to activate the pad in case this pad is added in the PAUSED or PLAYING
- * state. See gst_pad_set_active() for more information about activating pads.
+ * Pads are automatically activated when added in the PAUSED or PLAYING
+ * state.
  *
  * The pad and the element should be unlocked when calling this function.
  *
@@ -685,9 +684,6 @@ gst_element_add_pad (GstElement * element, GstPad * pad)
   /* check for active pads */
   if (!active && (GST_STATE (element) > GST_STATE_READY ||
           GST_STATE_NEXT (element) == GST_STATE_PAUSED)) {
-    g_warning ("adding inactive pad '%s' to running element '%s', you need to "
-        "use gst_pad_set_active(pad,TRUE) before adding it.",
-        GST_STR_NULL (pad_name), GST_ELEMENT_NAME (element));
     gst_pad_set_active (pad, TRUE);
   }