Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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);
- newtype TagSetter = TagSetter (ManagedPtr TagSetter)
- noTagSetter :: Maybe TagSetter
- class GObject o => IsTagSetter o
- toTagSetter :: IsTagSetter o => o -> IO TagSetter
- data TagSetterAddTagValueMethodInfo
- tagSetterAddTagValue :: (HasCallStack, MonadIO m, IsTagSetter a) => a -> TagMergeMode -> Text -> GValue -> m ()
- data TagSetterGetTagListMethodInfo
- tagSetterGetTagList :: (HasCallStack, MonadIO m, IsTagSetter a) => a -> m (Maybe TagList)
- data TagSetterGetTagMergeModeMethodInfo
- tagSetterGetTagMergeMode :: (HasCallStack, MonadIO m, IsTagSetter a) => a -> m TagMergeMode
- data TagSetterMergeTagsMethodInfo
- tagSetterMergeTags :: (HasCallStack, MonadIO m, IsTagSetter a) => a -> TagList -> TagMergeMode -> m ()
- data TagSetterResetTagsMethodInfo
- tagSetterResetTags :: (HasCallStack, MonadIO m, IsTagSetter a) => a -> m ()
- data TagSetterSetTagMergeModeMethodInfo
- tagSetterSetTagMergeMode :: (HasCallStack, MonadIO m, IsTagSetter a) => a -> TagMergeMode -> m ()
Exported types
GObject TagSetter Source # | |
IsObject TagSetter Source # | |
IsObject TagSetter Source # | |
IsElement TagSetter Source # | |
IsTagSetter TagSetter Source # | |
((~) * info (ResolveTagSetterMethod t TagSetter), MethodInfo * info TagSetter p) => IsLabel t (TagSetter -> p) Source # | |
((~) * info (ResolveTagSetterMethod t TagSetter), MethodInfo * info TagSetter p) => IsLabelProxy t (TagSetter -> p) Source # | |
HasAttributeList * TagSetter Source # | |
type AttributeList TagSetter Source # | |
type SignalList TagSetter Source # | |
class GObject o => IsTagSetter o Source #
toTagSetter :: IsTagSetter o => o -> IO TagSetter Source #
Methods
addTagValue
data TagSetterAddTagValueMethodInfo Source #
((~) * signature (TagMergeMode -> Text -> GValue -> m ()), MonadIO m, IsTagSetter a) => MethodInfo * TagSetterAddTagValueMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTagSetter a) | |
=> a |
|
-> TagMergeMode |
|
-> Text |
|
-> GValue |
|
-> m () |
Adds the given tag / GValue pair on the setter using the given merge mode.
getTagList
data TagSetterGetTagListMethodInfo Source #
((~) * signature (m (Maybe TagList)), MonadIO m, IsTagSetter a) => MethodInfo * TagSetterGetTagListMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTagSetter a) | |
=> a |
|
-> m (Maybe TagList) | Returns: a current snapshot of the
taglist used in the setter or |
Returns the current list of tags the setter uses. The list should not be modified or freed.
This function is not thread-safe.
getTagMergeMode
data TagSetterGetTagMergeModeMethodInfo Source #
((~) * signature (m TagMergeMode), MonadIO m, IsTagSetter a) => MethodInfo * TagSetterGetTagMergeModeMethodInfo a signature Source # | |
tagSetterGetTagMergeMode Source #
:: (HasCallStack, MonadIO m, IsTagSetter a) | |
=> a |
|
-> 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
data TagSetterMergeTagsMethodInfo Source #
((~) * signature (TagList -> TagMergeMode -> m ()), MonadIO m, IsTagSetter a) => MethodInfo * TagSetterMergeTagsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTagSetter a) | |
=> a |
|
-> TagList |
|
-> TagMergeMode |
|
-> m () |
Merges the given list into the setter's list using the given mode.
resetTags
data TagSetterResetTagsMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsTagSetter a) => MethodInfo * TagSetterResetTagsMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsTagSetter a) | |
=> a |
|
-> m () |
Reset the internal taglist. Elements should call this from within the state-change handler.
setTagMergeMode
data TagSetterSetTagMergeModeMethodInfo Source #
((~) * signature (TagMergeMode -> m ()), MonadIO m, IsTagSetter a) => MethodInfo * TagSetterSetTagMergeModeMethodInfo a signature Source # | |
tagSetterSetTagMergeMode Source #
:: (HasCallStack, MonadIO m, IsTagSetter a) | |
=> a |
|
-> TagMergeMode |
|
-> 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.