for (tmp = features; tmp; tmp = tmp->next) {
GstPluginFeature *feature = tmp->data;
if (GST_IS_ELEMENT_FACTORY (feature)) {
+ GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
+ if (gst_element_factory_get_skip_documentation (factory))
+ continue;
+
if (!f)
g_string_append_printf (json, ",");
_add_element_details (json, other_types, seen_other_types, feature);
/* this is used in gstelementfactory.c:gst_element_register() */
GQuark __gst_elementclass_factory = 0;
+/* used for gst_element_type_set_skip_documentation() and
+ * gst_element_factory_get_skip_documentation() */
+GQuark __gst_elementclass_skip_doc = 0;
+
GType
gst_element_get_type (void)
{
__gst_elementclass_factory =
g_quark_from_static_string ("GST_ELEMENTCLASS_FACTORY");
+ __gst_elementclass_skip_doc =
+ g_quark_from_static_string ("GST_ELEMENTCLASS_SKIP_DOCUMENTATION");
g_once_init_leave (&gst_element_type, _type);
}
return gst_element_type;
/* this is defined in gstelement.c */
extern GQuark __gst_elementclass_factory;
+extern GQuark __gst_elementclass_skip_doc;
#define _do_init \
{ \
}
}
+/**
+ * gst_element_type_set_skip_documentation:
+ * @type: a #GType of element
+ *
+ * Marks @type as "documentation should be skipped".
+ * Can be useful for dynamically registered element to be excluded from
+ * plugin documentation system.
+ *
+ * Example:
+ * ```c
+ * GType my_type;
+ * GTypeInfo my_type_info;
+ *
+ * // Fill "my_type_info"
+ * ...
+ *
+ * my_type = g_type_register_static (GST_TYPE_MY_ELEMENT, "my-type-name",
+ * &my_type_info, 0);
+ * gst_element_type_set_skip_documentation (my_type);
+ * gst_element_register (plugin, "my-plugin-feature-name", rank, my_type);
+ * ```
+ *
+ * Since: 1.20
+ */
+void
+gst_element_type_set_skip_documentation (GType type)
+{
+ g_return_if_fail (g_type_is_a (type, GST_TYPE_ELEMENT));
+
+ g_type_set_qdata (type, __gst_elementclass_skip_doc, GINT_TO_POINTER (1));
+}
+
+/**
+ * gst_element_factory_get_skip_documentation:
+ * @factory: a #GstElementFactory to query documentation skip
+ *
+ * Queries whether registered element managed by @factory needs to
+ * be excluded from documentation system or not.
+ *
+ * Returns: %TRUE if documentation should be skipped
+ *
+ * Since: 1.20
+ */
+gboolean
+gst_element_factory_get_skip_documentation (GstElementFactory * factory)
+{
+ g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), TRUE);
+
+ if (g_type_get_qdata (factory->type, __gst_elementclass_skip_doc))
+ return TRUE;
+
+ return FALSE;
+}
+
static gboolean
gst_element_factory_property_valist_to_array (const gchar * first,
va_list properties, GType object_type, guint * n, const gchar ** names[],