meta: API: Add gst_meta_api_type_get_tags() to get all meta tags.

This commit is contained in:
Mathieu Duponchelle 2013-08-22 21:32:36 +02:00 committed by Sebastian Dröge
parent 26e27417d7
commit 4c7dbde791
2 changed files with 24 additions and 0 deletions

View file

@ -98,6 +98,10 @@ gst_meta_api_type_register (const gchar * api, const gchar ** tags)
GINT_TO_POINTER (TRUE));
}
}
g_type_set_qdata (type, g_quark_from_string ("tags"),
g_strdupv ((gchar **) tags));
return type;
}
@ -119,6 +123,25 @@ gst_meta_api_type_has_tag (GType api, GQuark tag)
return g_type_get_qdata (api, tag) != NULL;
}
/**
* gst_meta_api_type_get_tags:
* @api: an API
*
* Returns: (transfer none) (array zero-terminated=1) (element-type utf8): an array of tags as strings.
*
* Since: 1.2
*/
const gchar *const *
gst_meta_api_type_get_tags (GType api)
{
const gchar **tags;
g_return_val_if_fail (api != 0, FALSE);
tags = g_type_get_qdata (api, g_quark_from_string ("tags"));
return (const gchar * const *) tags;
}
/**
* gst_meta_register:
* @api: the type of the #GstMeta API

View file

@ -199,6 +199,7 @@ const GstMetaInfo * gst_meta_register (GType api, const gchar *impl,
GstMetaFreeFunction free_func,
GstMetaTransformFunction transform_func);
const GstMetaInfo * gst_meta_get_info (const gchar * impl);
const gchar* const* gst_meta_api_type_get_tags (GType api);
/* some default tags */
GST_EXPORT GQuark _gst_meta_tag_memory;