meta: API: Add gst_meta_api_type_get_tags() to get all meta tags.
authorMathieu Duponchelle <mathieu.duponchelle@epitech.eu>
Thu, 22 Aug 2013 19:32:36 +0000 (21:32 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Mon, 9 Sep 2013 13:32:18 +0000 (15:32 +0200)
gst/gstmeta.c
gst/gstmeta.h

index 819c72e..fe8159c 100644 (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;
 }
 
@@ -120,6 +124,25 @@ gst_meta_api_type_has_tag (GType api, GQuark tag)
 }
 
 /**
+ * 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
  * @impl: the name of the #GstMeta implementation
index 08411e3..0a6cd78 100644 (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;