# GstTagsetter

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

     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);
     application_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);

## GstTagSetter

Opaque GstTagSetter data structure.

## Gst.TagSetter

Opaque Gst.TagSetter data structure.

## Gst.TagSetter

Opaque Gst.TagSetter data structure.

### Methods

#### gst_tag_setter_add_tag_valist

    gst_tag_setter_add_tag_valist (GstTagSetter * setter,
                                   GstTagMergeMode mode,
                                   const gchar * tag,
                                   va_list var_args)

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

Parameters:

`setter` –

a GstTagSetter

`mode` –

the mode to use

`tag` –

tag to set

`var_args` –

tag / value pairs to set

#### gst_tag_setter_add_tag_valist_values

    gst_tag_setter_add_tag_valist_values (GstTagSetter * setter,
                                          GstTagMergeMode mode,
                                          const gchar * tag,
                                          va_list var_args)

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

Parameters:

`setter` –

a GstTagSetter

`mode` –

the mode to use

`tag` –

tag to set

`var_args` –

tag / GValue pairs to set

#### gst_tag_setter_add_tag_value

    gst_tag_setter_add_tag_value (GstTagSetter * setter,
                                  GstTagMergeMode mode,
                                  const gchar * tag,
                                  const GValue * value)

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

Parameters:

`setter` –

a GstTagSetter

`mode` –

the mode to use

`tag` –

tag to set

`value` –

GValue to set for the tag

#### Gst.TagSetter.prototype.add_tag_value

    function Gst.TagSetter.prototype.add_tag_value(mode: Gst.TagMergeMode, tag: String, value: GObject.Value): {
        // javascript wrapper for 'gst_tag_setter_add_tag_value'
    }

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

`mode` (Gst.TagMergeMode) –

the mode to use

`tag` (String) –

tag to set

`value` (GObject.Value) –

GValue to set for the tag

#### Gst.TagSetter.add_tag_value

    def Gst.TagSetter.add_tag_value (self, mode, tag, value):
        #python wrapper for 'gst_tag_setter_add_tag_value'

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

`mode` (Gst.TagMergeMode) –

the mode to use

`tag` (str) –

tag to set

`value` (GObject.Value) –

GValue to set for the tag

#### gst_tag_setter_add_tag_values

    gst_tag_setter_add_tag_values (GstTagSetter * setter,
                                   GstTagMergeMode mode,
                                   const gchar * tag,
                                   ... ...)

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

Parameters:

`setter` –

a GstTagSetter

`mode` –

the mode to use

`tag` –

tag to set

`...` –

more tag / GValue pairs to set

#### gst_tag_setter_add_tags

    gst_tag_setter_add_tags (GstTagSetter * setter,
                             GstTagMergeMode mode,
                             const gchar * tag,
                             ... ...)

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

Parameters:

`setter` –

a GstTagSetter

`mode` –

the mode to use

`tag` –

tag to set

`...` –

more tag / value pairs to set

#### gst_tag_setter_get_tag_list

    const GstTagList *
    gst_tag_setter_get_tag_list (GstTagSetter * setter)

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

This function is not thread-safe.

Parameters:

`setter` –

a GstTagSetter

Returns ( [transfer: none][nullable]) –

a current snapshot of the taglist used in the setter or NULL if none is used.

#### Gst.TagSetter.prototype.get_tag_list

    function Gst.TagSetter.prototype.get_tag_list(): {
        // javascript wrapper for 'gst_tag_setter_get_tag_list'
    }

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

This function is not thread-safe.

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

Returns (Gst.TagList) –

a current snapshot of the taglist used in the setter or null if none is used.

#### Gst.TagSetter.get_tag_list

    def Gst.TagSetter.get_tag_list (self):
        #python wrapper for 'gst_tag_setter_get_tag_list'

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

This function is not thread-safe.

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

Returns (Gst.TagList) –

a current snapshot of the taglist used in the setter or None if none is used.

#### gst_tag_setter_get_tag_merge_mode

    GstTagMergeMode
    gst_tag_setter_get_tag_merge_mode (GstTagSetter * setter)

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

Parameters:

`setter` –

a GstTagSetter

Returns –

the merge mode used inside the element.

#### Gst.TagSetter.prototype.get_tag_merge_mode

    function Gst.TagSetter.prototype.get_tag_merge_mode(): {
        // javascript wrapper for 'gst_tag_setter_get_tag_merge_mode'
    }

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

Returns (Gst.TagMergeMode) –

the merge mode used inside the element.

#### Gst.TagSetter.get_tag_merge_mode

    def Gst.TagSetter.get_tag_merge_mode (self):
        #python wrapper for 'gst_tag_setter_get_tag_merge_mode'

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

Returns (Gst.TagMergeMode) –

the merge mode used inside the element.

#### gst_tag_setter_merge_tags

    gst_tag_setter_merge_tags (GstTagSetter * setter,
                               const GstTagList * list,
                               GstTagMergeMode mode)

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

Parameters:

`setter` –

a GstTagSetter

`list` –

a tag list to merge from

`mode` –

the mode to merge with

#### Gst.TagSetter.prototype.merge_tags

    function Gst.TagSetter.prototype.merge_tags(list: Gst.TagList, mode: Gst.TagMergeMode): {
        // javascript wrapper for 'gst_tag_setter_merge_tags'
    }

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

`list` (Gst.TagList) –

a tag list to merge from

`mode` (Gst.TagMergeMode) –

the mode to merge with

#### Gst.TagSetter.merge_tags

    def Gst.TagSetter.merge_tags (self, list, mode):
        #python wrapper for 'gst_tag_setter_merge_tags'

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

`list` (Gst.TagList) –

a tag list to merge from

`mode` (Gst.TagMergeMode) –

the mode to merge with

#### gst_tag_setter_reset_tags

    gst_tag_setter_reset_tags (GstTagSetter * setter)

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

Parameters:

`setter` –

a GstTagSetter

#### Gst.TagSetter.prototype.reset_tags

    function Gst.TagSetter.prototype.reset_tags(): {
        // javascript wrapper for 'gst_tag_setter_reset_tags'
    }

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

#### Gst.TagSetter.reset_tags

    def Gst.TagSetter.reset_tags (self):
        #python wrapper for 'gst_tag_setter_reset_tags'

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

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

#### gst_tag_setter_set_tag_merge_mode

    gst_tag_setter_set_tag_merge_mode (GstTagSetter * setter,
                                       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.

Parameters:

`setter` –

a GstTagSetter

`mode` –

The mode with which tags are added

#### Gst.TagSetter.prototype.set_tag_merge_mode

    function Gst.TagSetter.prototype.set_tag_merge_mode(mode: Gst.TagMergeMode): {
        // javascript wrapper for 'gst_tag_setter_set_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.TagMergeMode.KEEP, which keeps the tags set with this interface and discards tags from events.

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

`mode` (Gst.TagMergeMode) –

The mode with which tags are added

#### Gst.TagSetter.set_tag_merge_mode

    def Gst.TagSetter.set_tag_merge_mode (self, mode):
        #python wrapper for 'gst_tag_setter_set_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.TagMergeMode.KEEP, which keeps the tags set with this interface and discards tags from events.

Parameters:

`setter` (Gst.TagSetter) –

a Gst.TagSetter

`mode` (Gst.TagMergeMode) –

The mode with which tags are added

## Function Macros

### GST_TAG_SETTER_GET_INTERFACE

    #define GST_TAG_SETTER_GET_INTERFACE(obj)       (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_TAG_SETTER, GstTagSetterInterface))

The results of the search are