| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Gst.Structs.Meta
Description
The Meta structure should be included as the first member of a Buffer
metadata structure. The structure defines the API of the metadata and should
be accessible to all elements using the metadata.
A metadata API is registered with metaApiTypeRegister which takes a
name for the metadata API and some tags associated with the metadata.
With metaApiTypeHasTag one can check if a certain metadata API
contains a given tag.
Multiple implementations of a metadata API can be registered.
To implement a metadata API, metaRegister should be used. This
function takes all parameters needed to create, free and transform metadata
along with the size of the metadata. The function returns a MetaInfo
structure that contains the information for the implementation of the API.
A specific implementation can be retrieved by name with metaGetInfo.
See Buffer for how the metadata can be added, retrieved and removed from
buffers.
Synopsis
- newtype Meta = Meta (ManagedPtr Meta)
- newZeroMeta :: MonadIO m => m Meta
- metaApiTypeGetTags :: (HasCallStack, MonadIO m) => GType -> m [Text]
- metaApiTypeHasTag :: (HasCallStack, MonadIO m) => GType -> Word32 -> m Bool
- metaApiTypeRegister :: (HasCallStack, MonadIO m) => Text -> [Text] -> m GType
- metaCompareSeqnum :: (HasCallStack, MonadIO m) => Meta -> Meta -> m Int32
- metaGetInfo :: (HasCallStack, MonadIO m) => Text -> m (Maybe MetaInfo)
- metaGetSeqnum :: (HasCallStack, MonadIO m) => Meta -> m Word64
- metaRegister :: (HasCallStack, MonadIO m) => GType -> Text -> Word64 -> MetaInitFunction -> MetaFreeFunction -> MetaTransformFunction -> m MetaInfo
- metaRegisterCustom :: (HasCallStack, MonadIO m) => Text -> [Text] -> Maybe CustomMetaTransformFunction -> m MetaInfo
- getMetaFlags :: MonadIO m => Meta -> m [MetaFlags]
- setMetaFlags :: MonadIO m => Meta -> [MetaFlags] -> m ()
- clearMetaInfo :: MonadIO m => Meta -> m ()
- getMetaInfo :: MonadIO m => Meta -> m (Maybe MetaInfo)
- setMetaInfo :: MonadIO m => Meta -> Ptr MetaInfo -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq Meta Source # | |
| BoxedPtr Meta Source # | |
Defined in GI.Gst.Structs.Meta | |
| CallocPtr Meta Source # | |
Defined in GI.Gst.Structs.Meta Methods boxedPtrCalloc :: IO (Ptr Meta) | |
| ManagedPtrNewtype Meta Source # | |
Defined in GI.Gst.Structs.Meta Methods toManagedPtr :: Meta -> ManagedPtr Meta | |
| tag ~ 'AttrSet => Constructible Meta tag Source # | |
Methods
Click to display all available methods, including inherited ones
apiTypeGetTags
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GType |
|
| -> m [Text] | Returns: an array of tags as strings. |
No description available in the introspection data.
Since: 1.2
apiTypeHasTag
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GType |
|
| -> Word32 |
|
| -> m Bool | Returns: |
Check if api was registered with tag.
apiTypeRegister
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> [Text] |
|
| -> m GType | Returns: a unique GType for |
Register and return a GType for the api and associate it with
tags.
compareSeqnum
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Meta |
|
| -> Meta |
|
| -> m Int32 | Returns: a negative number if |
Meta sequence number compare function. Can be used as CompareFunc
or a CompareDataFunc.
Since: 1.16
getInfo
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m (Maybe MetaInfo) | Returns: a |
Lookup a previously registered meta info structure by its implementation name
impl.
getSeqnum
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Meta |
|
| -> m Word64 |
Gets seqnum for this meta.
Since: 1.16
register
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GType |
|
| -> Text |
|
| -> Word64 |
|
| -> MetaInitFunction |
|
| -> MetaFreeFunction |
|
| -> MetaTransformFunction |
|
| -> m MetaInfo | Returns: a |
Register a new Meta implementation.
The same info can be retrieved later with metaGetInfo by using
impl as the key.
registerCustom
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> [Text] |
|
| -> Maybe CustomMetaTransformFunction |
|
| -> m MetaInfo | Returns: a |
Register a new custom Meta implementation, backed by an opaque
structure holding a Structure.
The registered info can be retrieved later with metaGetInfo by using
name as the key.
The backing Structure can be retrieved with
customMetaGetStructure, its mutability is conditioned by the
writability of the buffer the meta is attached to.
When transformFunc is Nothing, the meta and its backing Structure
will always be copied when the transform operation is copy, other operations
are discarded, copy regions are ignored.
Since: 1.20
Properties
flags
extra flags for the metadata
getMetaFlags :: MonadIO m => Meta -> m [MetaFlags] Source #
Get the value of the “flags” field.
When overloading is enabled, this is equivalent to
get meta #flags
setMetaFlags :: MonadIO m => Meta -> [MetaFlags] -> m () Source #
Set the value of the “flags” field.
When overloading is enabled, this is equivalent to
setmeta [ #flags:=value ]
info
pointer to the MetaInfo
clearMetaInfo :: MonadIO m => Meta -> m () Source #
Set the value of the “info” field to Nothing.
When overloading is enabled, this is equivalent to
clear #info
getMetaInfo :: MonadIO m => Meta -> m (Maybe MetaInfo) Source #
Get the value of the “info” field.
When overloading is enabled, this is equivalent to
get meta #info
setMetaInfo :: MonadIO m => Meta -> Ptr MetaInfo -> m () Source #
Set the value of the “info” field.
When overloading is enabled, this is equivalent to
setmeta [ #info:=value ]