2004-05-10 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ * gst/gstelement.c: (gst_element_class_init),
+ (gst_element_no_more_pads):
+ * gst/gstelement.h:
+ add gst_element_no_more_pads and the "no-more-pads" signal
+
+2004-05-10 Benjamin Otte <in7y118@public.uni-hamburg.de>
+
* gst/gstregistry.c: (gst_registry_add_plugin):
refuse to add plugins when a plugin with same name is already
registered. Fixes a bunch of "How to remove plugins?" issues.
ERROR,
EOS,
FOUND_TAG,
+ NO_MORE_PADS,
/* add more above */
LAST_SIGNAL
};
G_STRUCT_OFFSET (GstElementClass, found_tag), NULL, NULL,
gst_marshal_VOID__OBJECT_BOXED, G_TYPE_NONE, 2, GST_TYPE_ELEMENT,
GST_TYPE_TAG_LIST);
+ gst_element_signals[FOUND_TAG] =
+ g_signal_new ("no-more-pads", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstElementClass, no_more_pads), NULL,
+ NULL, gst_marshal_VOID__VOID, G_TYPE_NONE, 0);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_element_real_set_property);
gst_element_remove_pad (element, pad);
}
+/**
+ * gst_element_no_more_pads:
+ * @element: a #GstElement
+ *
+ * Use this function to signal that the element does not expect any more pads
+ * to show up in the current pipeline. This function should be called whenever
+ * pads have been added by the element itself. Elements with GST_PAD_SOMETIMES
+ * pad templates use this in combination with autopluggers to figure out that
+ * the element is done initializing its pads.
+ */
+void
+gst_element_no_more_pads (GstElement * element)
+{
+ g_return_if_fail (GST_IS_ELEMENT (element));
+
+ g_signal_emit (element, gst_element_signals[NO_MORE_PADS], 0);
+}
/**
* gst_element_get_pad:
void (*set_index) (GstElement *element, GstIndex *index);
GstElementStateReturn (*set_state) (GstElement *element, GstElementState state);
- gpointer _gst_reserved[GST_PADDING];
+
+ /* FIXME 0.9: move up to signals */
+ void (*no_more_pads) (GstElement *element);
+
+ gpointer _gst_reserved[GST_PADDING - 1];
};
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
void gst_element_add_pad (GstElement *element, GstPad *pad);
void gst_element_remove_pad (GstElement *element, GstPad *pad);
GstPad * gst_element_add_ghost_pad (GstElement *element, GstPad *pad, const gchar *name);
+#ifndef GST_DISABLE_DEPRECATED
void gst_element_remove_ghost_pad (GstElement *element, GstPad *pad);
+#endif
+void gst_element_no_more_pads (GstElement *element);
GstPad* gst_element_get_pad (GstElement *element, const gchar *name);
GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name);