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 |
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, gst_meta_register()
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
- metaDeserialize :: (HasCallStack, MonadIO m) => Buffer -> Word8 -> CSize -> m (Maybe Meta, Word32)
- metaGetInfo :: (HasCallStack, MonadIO m) => Text -> m (Maybe MetaInfo)
- metaGetSeqnum :: (HasCallStack, MonadIO m) => Meta -> m Word64
- metaRegisterCustom :: (HasCallStack, MonadIO m) => Text -> [Text] -> Maybe CustomMetaTransformFunction -> m MetaInfo
- metaRegisterCustomSimple :: (HasCallStack, MonadIO m) => Text -> m MetaInfo
- metaSerialize :: (HasCallStack, MonadIO m) => Meta -> ByteArrayInterface -> m Bool
- metaSerializeSimple :: (HasCallStack, MonadIO m) => Meta -> ByteString -> m Bool
- 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 boxedPtrCopy :: Meta -> IO Meta boxedPtrFree :: Meta -> IO () | |
CallocPtr Meta Source # | |
Defined in GI.Gst.Structs.Meta boxedPtrCalloc :: IO (Ptr Meta) | |
ManagedPtrNewtype Meta Source # | |
Defined in GI.Gst.Structs.Meta toManagedPtr :: Meta -> ManagedPtr Meta | |
tag ~ 'AttrSet => Constructible Meta tag Source # | |
Methods
Click to display all available methods, including inherited ones
apiTypeGetTags
:: (HasCallStack, MonadIO m) | |
=> GType |
|
-> m [Text] | Returns: an array of tags as strings. |
No description available in the introspection data.
Since: 1.2
apiTypeHasTag
:: (HasCallStack, MonadIO m) | |
=> GType |
|
-> Word32 |
|
-> m Bool | Returns: |
Check if api
was registered with tag
.
apiTypeRegister
:: (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
:: (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
deserialize
:: (HasCallStack, MonadIO m) | |
=> Buffer |
|
-> Word8 |
|
-> CSize |
|
-> m (Maybe Meta, Word32) | Returns: the metadata owned by |
Recreate a Meta
from serialized data returned by
metaSerialize
and add it to buffer
.
Note that the meta must have been previously registered by calling one of
gst_*_meta_get_info ()
functions.
consumed
is set to the number of bytes that can be skipped from data
to
find the next meta serialization, if any. In case of parsing error that does
not allow to determine that size, consumed
is set to 0.
Since: 1.24
getInfo
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe MetaInfo) | Returns: a |
Lookup a previously registered meta info structure by its implementation name
impl
.
getSeqnum
:: (HasCallStack, MonadIO m) | |
=> Meta |
|
-> m Word64 |
Gets seqnum for this meta.
Since: 1.16
registerCustom
:: (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
registerCustomSimple
metaRegisterCustomSimple Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m MetaInfo | Returns: a |
Simplified version of metaRegisterCustom
, with no tags and no
transform function.
Since: 1.24
serialize
:: (HasCallStack, MonadIO m) | |
=> Meta |
|
-> ByteArrayInterface |
|
-> m Bool |
Serialize meta
into a format that can be stored or transmitted and later
deserialized by metaDeserialize
.
This is only supported for meta that implements MetaInfo
.serialize_func
,
False
is returned otherwise.
Upon failure, data
->data pointer could have been reallocated, but data
->len
won't be modified. This is intended to be able to append multiple metas
into the same ByteArray
.
Since serialization size is often the same for every buffer, caller may want to remember the size of previous data to preallocate the next.
Since: 1.24
serializeSimple
:: (HasCallStack, MonadIO m) | |
=> Meta |
|
-> ByteString |
|
-> m Bool |
Same as metaSerialize
but with a ByteArray
instead of
ByteArrayInterface
.
Since: 1.24
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
set
meta [ #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
set
meta [ #info:=
value ]