Next: , Previous: GstTagList, Up: Top


36 GstTagSetter

Element interface that allows setting and retrieval of media metadata

36.1 Overview

36.2

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. gst-tag-setter-merge-tags or gst-tag-setter-add-tags. The application should do that before the element goes to ‘GST_STATE_PAUSED’.

Elements implementing the <gst-tag-setter> 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:

     
     GstTagMergeMode merge_mode;
     const GstTagList *application_tags;
     const GstTagList *event_tags;
     GstTagSetter *tagsetter;
     GstTagList *result;
     
     tagsetter = GST_TAG_SETTER (element);
     
     merge_mode = gst_tag_setter_get_tag_merge_mode (tagsetter);
     tagsetter_tags = gst_tag_setter_get_tag_list (tagsetter);
     event_tags = (const GstTagList *) element->event_tags;
     
     GST_LOG_OBJECT (tagsetter, "merging tags, merge mode = %d", merge_mode);
     GST_LOG_OBJECT (tagsetter, "event tags: %" GST_PTR_FORMAT, event_tags);
     GST_LOG_OBJECT (tagsetter, "set   tags: %" GST_PTR_FORMAT, application_tags);
     
     result = gst_tag_list_merge (application_tags, event_tags, merge_mode);
     
     GST_LOG_OBJECT (tagsetter, "final tags: %" GST_PTR_FORMAT, result);

Last reviewed on 2006-05-18 (0.10.6)

36.3 Usage

— Function: gst-tag-setter-merge-tags (self <gst-tag-setter*>) (list <gst-tag-list*>) (mode <gst-tag-merge-mode>)

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

setter
a <gst-tag-setter>
list
a tag list to merge from
mode
the mode to merge with
— Function: gst-tag-setter-get-tag-list (self <gst-tag-setter*>)   (ret <gst-tag-list*>)

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

setter
a <gst-tag-setter>
ret
a current snapshot of the taglist used in the setter or NULL if none is used.
— Function: gst-tag-setter-set-tag-merge-mode (self <gst-tag-setter*>) (mode <gst-tag-merge-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.

setter
a <gst-tag-setter>
mode
The mode with which tags are added
— Function: gst-tag-setter-get-tag-merge-mode (self <gst-tag-setter*>)   (ret <gst-tag-merge-mode>)

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

setter
a <gst-tag-setter>
ret
the merge mode used inside the element.