element: add method to get metadata

Add a method to get the metadata from a klass.
This commit is contained in:
Wim Taymans 2011-05-20 12:43:24 +02:00
parent 1c5c5177f3
commit e8080ab874
2 changed files with 20 additions and 0 deletions

View file

@ -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.

View file

@ -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 */