TagSetterIF

Element interface that allows setting of media metadata.

Elements that support changing a stream's metadata will implement this interface. Examples of such elements are 'vorbisenc', 'theoraenc' and 'id3v2mux'.

If you just want to retrieve metadata in your application then all you need to do is watch for tag messages on your pipeline's bus. This interface is only for setting metadata, not for extracting it. To set tags from the application, find tagsetter elements and set tags using e.g. Tag.setterMergeTags or Tag.setterAddTags. Also consider setting the GstTagMergeMode that is used for tag events that arrive at the tagsetter element (default mode is to keep existing tags). The application should do that before the element goes to GST_STATE_PAUSED.

Elements implementing the GstTagSetter interface often have to merge any tags received from upstream and the tags set by the application via the interface. This can be done like this:

1 
2 GstTagMergeMode merge_mode;
3 const GstTagList *application_tags;
4 const GstTagList *event_tags;
5 GstTagSetter *tagsetter;
6 GstTagList *result;
7 
8 tagsetter = GST_TAG_SETTER (element);
9 
10 merge_mode = gst_tag_setter_get_tag_merge_mode (tagsetter);
11 application_tags = gst_tag_setter_get_tag_list (tagsetter);
12 event_tags = (const GstTagList *) element->event_tags;
13 
14 GST_LOG_OBJECT (tagsetter, "merging tags, merge mode = `d`", merge_mode);
15 GST_LOG_OBJECT (tagsetter, "event tags: %" GST_PTR_FORMAT, event_tags);
16 GST_LOG_OBJECT (tagsetter, "set   tags: %" GST_PTR_FORMAT, application_tags);
17 
18 result = gst_tag_list_merge (application_tags, event_tags, merge_mode);
19 
20 GST_LOG_OBJECT (tagsetter, "final tags: %" GST_PTR_FORMAT, result);

Members

Functions

addTagValist
void addTagValist(GstTagMergeMode mode, string tag, void* varArgs)

Adds the given tag / value pairs on the setter using the given merge mode. The list must be terminated with NULL.

addTagValistValues
void addTagValistValues(GstTagMergeMode mode, string tag, void* varArgs)

Adds the given tag / GValue pairs on the setter using the given merge mode. The list must be terminated with NULL.

addTagValue
void addTagValue(GstTagMergeMode mode, string tag, Value value)

Adds the given tag / GValue pair on the setter using the given merge mode.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTagList
TagList getTagList()

Returns the current list of tags the setter uses. The list should not be modified or freed.

getTagMergeMode
GstTagMergeMode getTagMergeMode()

Queries the mode by which tags inside the setter are overwritten by tags from events

getTagSetterStruct
GstTagSetter* getTagSetterStruct(bool transferOwnership = false)

Get the main Gtk struct

mergeTags
void mergeTags(TagList list, GstTagMergeMode mode)

Merges the given list into the setter's list using the given mode.

resetTags
void resetTags()

Reset the internal taglist. Elements should call this from within the state-change handler.

setTagMergeMode
void setTagMergeMode(GstTagMergeMode mode)

Sets the given merge mode that is used for adding tags from events to tags specified by this interface. The default is GST_TAG_MERGE_KEEP, which keeps the tags set with this interface and discards tags from events.

Static functions

getType
GType getType()

Meta