mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
element: add method to get metadata
Add a method to get the metadata from a klass.
This commit is contained in:
parent
1c5c5177f3
commit
e8080ab874
2 changed files with 20 additions and 0 deletions
|
@ -1349,6 +1349,24 @@ gst_element_class_set_metadata (GstElementClass * klass,
|
||||||
GST_ELEMENT_METADATA_AUTHOR, G_TYPE_STRING, author, NULL);
|
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:
|
* gst_element_class_get_pad_template_list:
|
||||||
* @element_class: a #GstElementClass to get pad templates of.
|
* @element_class: a #GstElementClass to get pad templates of.
|
||||||
|
|
|
@ -674,6 +674,8 @@ void gst_element_class_set_metadata (GstElementClass
|
||||||
const gchar *author);
|
const gchar *author);
|
||||||
void gst_element_class_add_metadata (GstElementClass * klass,
|
void gst_element_class_add_metadata (GstElementClass * klass,
|
||||||
const gchar * key, const gchar * value);
|
const gchar * key, const gchar * value);
|
||||||
|
G_CONST_RETURN gchar * gst_element_class_get_metadata (GstElementClass * klass,
|
||||||
|
const gchar * key);
|
||||||
|
|
||||||
|
|
||||||
/* element instance */
|
/* element instance */
|
||||||
|
|
Loading…
Reference in a new issue