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

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, 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

Exported types

newtype Meta Source #

Memory-managed wrapper type.

Constructors

Meta (ManagedPtr Meta) 

Instances

Instances details
Eq Meta Source # 
Instance details

Defined in GI.Gst.Structs.Meta

Methods

(==) :: Meta -> Meta -> Bool #

(/=) :: Meta -> Meta -> Bool #

BoxedPtr Meta Source # 
Instance details

Defined in GI.Gst.Structs.Meta

Methods

boxedPtrCopy :: Meta -> IO Meta

boxedPtrFree :: Meta -> IO ()

CallocPtr Meta Source # 
Instance details

Defined in GI.Gst.Structs.Meta

ManagedPtrNewtype Meta Source # 
Instance details

Defined in GI.Gst.Structs.Meta

Methods

toManagedPtr :: Meta -> ManagedPtr Meta

tag ~ 'AttrSet => Constructible Meta tag Source # 
Instance details

Defined in GI.Gst.Structs.Meta

Methods

new :: MonadIO m => (ManagedPtr Meta -> Meta) -> [AttrOp Meta tag] -> m Meta

newZeroMeta :: MonadIO m => m Meta Source #

Construct a Meta struct initialized to zero.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

compareSeqnum, serialize, serializeSimple.

Getters

getSeqnum.

Setters

None.

apiTypeGetTags

metaApiTypeGetTags Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GType

api: an API

-> m [Text]

Returns: an array of tags as strings.

No description available in the introspection data.

Since: 1.2

apiTypeHasTag

metaApiTypeHasTag Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GType

api: an API

-> Word32

tag: the tag to check

-> m Bool

Returns: True if api was registered with tag.

Check if api was registered with tag.

apiTypeRegister

metaApiTypeRegister Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

api: an API to register

-> [Text]

tags: tags for api

-> m GType

Returns: a unique GType for api.

Register and return a GType for the api and associate it with tags.

compareSeqnum

metaCompareSeqnum Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Meta

meta1: a Meta

-> Meta

meta2: a Meta

-> m Int32

Returns: a negative number if meta1 comes before meta2, 0 if both metas have an equal sequence number, or a positive integer if meta1 comes after meta2.

Meta sequence number compare function. Can be used as CompareFunc or a CompareDataFunc.

Since: 1.16

deserialize

metaDeserialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Buffer

buffer: a Buffer

-> Word8

data: serialization data obtained from metaSerialize

-> CSize

size: size of data

-> m (Maybe Meta, Word32)

Returns: the metadata owned by buffer, or Nothing.

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

metaGetInfo Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

impl: the name

-> m (Maybe MetaInfo)

Returns: a MetaInfo with impl, or Nothing when no such metainfo exists.

Lookup a previously registered meta info structure by its implementation name impl.

getSeqnum

metaGetSeqnum Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Meta

meta: a Meta

-> m Word64 

Gets seqnum for this meta.

Since: 1.16

registerCustom

metaRegisterCustom Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the Meta implementation

-> [Text]

tags: tags for api

-> Maybe CustomMetaTransformFunction

transformFunc: a MetaTransformFunction

-> m MetaInfo

Returns: a MetaInfo that can be used to access metadata.

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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the Meta implementation

-> m MetaInfo

Returns: a MetaInfo that can be used to access metadata.

Simplified version of metaRegisterCustom, with no tags and no transform function.

Since: 1.24

serialize

metaSerialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Meta

meta: a Meta

-> ByteArrayInterface

data: ByteArrayInterface to append serialization data

-> m Bool

Returns: True on success, False otherwise.

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

metaSerializeSimple Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Meta

meta: a Meta

-> ByteString

data: ByteArray to append serialization data

-> m Bool

Returns: True on success, False otherwise.

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 ]