gi-gst-1.0.26: GStreamer bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gst.Interfaces.TagSetter

Description

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. tagSetterMergeTags or gst_tag_setter_add_tags(). Also consider setting the TagMergeMode 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 StatePaused.

Elements implementing the TagSetter 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:

C code

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

Exported types

newtype TagSetter Source #

Memory-managed wrapper type.

Constructors

TagSetter (ManagedPtr TagSetter) 

Instances

Instances details
Eq TagSetter Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

GObject TagSetter Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

ManagedPtrNewtype TagSetter Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

Methods

toManagedPtr :: TagSetter -> ManagedPtr TagSetter

TypedObject TagSetter Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

Methods

glibType :: IO GType

HasParentTypes TagSetter Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

IsGValue (Maybe TagSetter) Source #

Convert TagSetter to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gst.Interfaces.TagSetter

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe TagSetter -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe TagSetter)

type ParentTypes TagSetter Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

type ParentTypes TagSetter = '[Element, Object, Object]

class (GObject o, IsDescendantOf TagSetter o) => IsTagSetter o Source #

Type class for types which can be safely cast to TagSetter, for instance with toTagSetter.

Instances

Instances details
(GObject o, IsDescendantOf TagSetter o) => IsTagSetter o Source # 
Instance details

Defined in GI.Gst.Interfaces.TagSetter

toTagSetter :: (MonadIO m, IsTagSetter o) => o -> m TagSetter Source #

Cast to TagSetter, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

abortState, addControlBinding, addPad, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, addTagValue, bindProperty, bindPropertyFull, callAsync, changeState, continueState, createAllPads, defaultError, forceFloating, foreachPad, foreachSinkPad, foreachSrcPad, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, isFloating, isLockedState, iteratePads, iterateSinkPads, iterateSrcPads, link, linkFiltered, linkPads, linkPadsFiltered, linkPadsFull, lostState, mergeTags, messageFull, messageFullWithDetails, noMorePads, notify, notifyByPspec, postMessage, provideClock, query, queryConvert, queryDuration, queryPosition, ref, refSink, releaseRequestPad, removeControlBinding, removePad, removePropertyNotifyWatch, requestPad, requestPadSimple, resetTags, runDispose, seek, seekSimple, sendEvent, stealData, stealQdata, suggestNextSync, syncStateWithParent, syncValues, thawNotify, unlink, unlinkPads, unparent, unref, watchClosure.

Getters

getBaseTime, getBus, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContextUnlocked, getContexts, getControlBinding, getControlRate, getCurrentClockTime, getCurrentRunningTime, getData, getFactory, getGValueArray, getMetadata, getName, getPadTemplate, getPadTemplateList, getParent, getPathString, getProperty, getQdata, getRequestPad, getStartTime, getState, getStaticPad, getTagList, getTagMergeMode, getValue.

Setters

setBaseTime, setBus, setClock, setContext, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setLockedState, setName, setParent, setProperty, setStartTime, setState, setTagMergeMode.

addTagValue

tagSetterAddTagValue Source #

Arguments

:: (HasCallStack, MonadIO m, IsTagSetter a) 
=> a

setter: a TagSetter

-> TagMergeMode

mode: the mode to use

-> Text

tag: tag to set

-> GValue

value: GValue to set for the tag

-> m () 

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

getTagList

tagSetterGetTagList Source #

Arguments

:: (HasCallStack, MonadIO m, IsTagSetter a) 
=> a

setter: a TagSetter

-> m (Maybe TagList)

Returns: a current snapshot of the taglist used in the setter or Nothing if none is used.

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

This function is not thread-safe.

getTagMergeMode

tagSetterGetTagMergeMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsTagSetter a) 
=> a

setter: a TagSetter

-> m TagMergeMode

Returns: the merge mode used inside the element.

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

mergeTags

tagSetterMergeTags Source #

Arguments

:: (HasCallStack, MonadIO m, IsTagSetter a) 
=> a

setter: a TagSetter

-> TagList

list: a tag list to merge from

-> TagMergeMode

mode: the mode to merge with

-> m () 

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

resetTags

tagSetterResetTags Source #

Arguments

:: (HasCallStack, MonadIO m, IsTagSetter a) 
=> a

setter: a TagSetter

-> m () 

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

setTagMergeMode

tagSetterSetTagMergeMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsTagSetter a) 
=> a

setter: a TagSetter

-> TagMergeMode

mode: The mode with which tags are added

-> m () 

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.