Commit e8080ab8 authored by Wim Taymans's avatar Wim Taymans

element: add method to get metadata

Add a method to get the metadata from a klass.
parent 1c5c5177
......@@ -1349,6 +1349,24 @@ gst_element_class_set_metadata (GstElementClass * klass,
GST_ELEMENT_METADATA_AUTHOR, G_TYPE_STRING, author, NULL);
}
/**
* gst_element_class_get_metadata:
* @klass: class to get metadata for
* @key: the key to get
*
* Get metadata with @key in @klass.
*
* Returns: the metadata for @key.
*/
G_CONST_RETURN gchar *
gst_element_class_get_metadata (GstElementClass * klass, const gchar * key)
{
g_return_val_if_fail (GST_IS_ELEMENT_CLASS (klass), NULL);
g_return_val_if_fail (key != NULL, NULL);
return gst_structure_get_string ((GstStructure *) klass->metadata, key);
}
/**
* gst_element_class_get_pad_template_list:
* @element_class: a #GstElementClass to get pad templates of.
......
......@@ -674,6 +674,8 @@ void gst_element_class_set_metadata (GstElementClass
const gchar *author);
void gst_element_class_add_metadata (GstElementClass * klass,
const gchar * key, const gchar * value);
G_CONST_RETURN gchar * gst_element_class_get_metadata (GstElementClass * klass,
const gchar * key);
/* element instance */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment