mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
tags: API: Add functions to add single tags to GstTagList or GstTagSetter
The new functions are gst_tag_setter_add_tag_value() and gst_tag_list_add_value()). This fixes bug #581198.
This commit is contained in:
parent
c003165b76
commit
ad8a35ff3e
4 changed files with 59 additions and 0 deletions
|
@ -895,6 +895,29 @@ gst_tag_list_add_valist_values (GstTagList * list, GstTagMergeMode mode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_tag_list_add_value:
|
||||||
|
* @list: list to set tags in
|
||||||
|
* @mode: the mode to use
|
||||||
|
* @tag: tag
|
||||||
|
* @value: GValue for this tag
|
||||||
|
*
|
||||||
|
* Sets the GValue for a given tag using the specified mode.
|
||||||
|
*
|
||||||
|
* Since: 0.10.24
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_tag_list_add_value (GstTagList * list, GstTagMergeMode mode,
|
||||||
|
const gchar * tag, const GValue * value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GST_IS_TAG_LIST (list));
|
||||||
|
g_return_if_fail (GST_TAG_MODE_IS_VALID (mode));
|
||||||
|
g_return_if_fail (tag != NULL);
|
||||||
|
|
||||||
|
gst_tag_list_add_value_internal (list, mode, g_quark_from_string (tag),
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_tag_list_remove_tag:
|
* gst_tag_list_remove_tag:
|
||||||
* @list: list to remove tag from
|
* @list: list to remove tag from
|
||||||
|
|
|
@ -226,6 +226,10 @@ void gst_tag_list_add_valist_values (GstTagList * list,
|
||||||
GstTagMergeMode mode,
|
GstTagMergeMode mode,
|
||||||
const gchar * tag,
|
const gchar * tag,
|
||||||
va_list var_args);
|
va_list var_args);
|
||||||
|
void gst_tag_list_add_value (GstTagList * list,
|
||||||
|
GstTagMergeMode mode,
|
||||||
|
const gchar * tag,
|
||||||
|
const GValue * value);
|
||||||
void gst_tag_list_remove_tag (GstTagList * list,
|
void gst_tag_list_remove_tag (GstTagList * list,
|
||||||
const gchar * tag);
|
const gchar * tag);
|
||||||
void gst_tag_list_foreach (const GstTagList * list,
|
void gst_tag_list_foreach (const GstTagList * list,
|
||||||
|
|
|
@ -300,6 +300,33 @@ gst_tag_setter_add_tag_valist_values (GstTagSetter * setter,
|
||||||
gst_tag_list_add_valist_values (data->list, mode, tag, var_args);
|
gst_tag_list_add_valist_values (data->list, mode, tag, var_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_tag_setter_add_tag_value:
|
||||||
|
* @setter: a #GstTagSetter
|
||||||
|
* @mode: the mode to use
|
||||||
|
* @tag: tag to set
|
||||||
|
* @value: GValue to set for the tag
|
||||||
|
*
|
||||||
|
* Adds the given tag / GValue pair on the setter using the given merge mode.
|
||||||
|
*
|
||||||
|
* Since: 0.10.24
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gst_tag_setter_add_tag_value (GstTagSetter * setter,
|
||||||
|
GstTagMergeMode mode, const gchar * tag, const GValue * value)
|
||||||
|
{
|
||||||
|
GstTagData *data;
|
||||||
|
|
||||||
|
g_return_if_fail (GST_IS_TAG_SETTER (setter));
|
||||||
|
g_return_if_fail (GST_TAG_MODE_IS_VALID (mode));
|
||||||
|
|
||||||
|
data = gst_tag_setter_get_data (setter);
|
||||||
|
if (!data->list)
|
||||||
|
data->list = gst_tag_list_new ();
|
||||||
|
|
||||||
|
gst_tag_list_add_value (data->list, mode, tag, value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_tag_setter_get_tag_list:
|
* gst_tag_setter_get_tag_list:
|
||||||
* @setter: a #GstTagSetter
|
* @setter: a #GstTagSetter
|
||||||
|
|
|
@ -83,6 +83,11 @@ void gst_tag_setter_add_tag_valist_values(GstTagSetter * setter,
|
||||||
const gchar * tag,
|
const gchar * tag,
|
||||||
va_list var_args);
|
va_list var_args);
|
||||||
|
|
||||||
|
void gst_tag_setter_add_tag_value (GstTagSetter * setter,
|
||||||
|
GstTagMergeMode mode,
|
||||||
|
const gchar * tag,
|
||||||
|
const GValue * value);
|
||||||
|
|
||||||
G_CONST_RETURN GstTagList *
|
G_CONST_RETURN GstTagList *
|
||||||
gst_tag_setter_get_tag_list (GstTagSetter * setter);
|
gst_tag_setter_get_tag_list (GstTagSetter * setter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue