Meta
- class Meta(*args, **kwargs)
- Constructors:
Meta()
Methods
- class Meta
-
- api_type_has_tag(api: type, tag: int) bool
Check if
api
was registered withtag
.- Parameters:
api – an API
tag – the tag to check
- api_type_register(api: str, tags: Sequence[str]) type
Register and return a GType for the
api
and associate it withtags
.- Parameters:
api – an API to register
tags – tags for
api
- compare_seqnum(meta2: Meta) int
Meta sequence number compare function. Can be used as
CompareFunc
or aCompareDataFunc
.Added in version 1.16.
- Parameters:
meta2 – a
Meta
- deserialize(buffer: Buffer, data: int, size: int) tuple[Meta | None, int]
Recreate a
Meta
from serialized data returned byserialize()
and add it tobuffer
.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 fromdata
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.Added in version 1.24.
- Parameters:
buffer – a
Buffer
data – serialization data obtained from
serialize()
size – size of
data
- get_info(impl: str) MetaInfo | None
Lookup a previously registered meta info structure by its implementation name
impl
.- Parameters:
impl – the name
- register_custom(name: str, tags: Sequence[str], transform_func: Callable[[...], bool] | None = None, *user_data: Any) MetaInfo
Register a new custom
Meta
implementation, backed by an opaque structure holding aStructure
.The registered info can be retrieved later with
get_info()
by usingname
as the key.The backing
Structure
can be retrieved withget_structure()
, its mutability is conditioned by the writability of the buffer the meta is attached to.When
transform_func
isNone
, the meta and its backingStructure
will always be copied when the transform operation is copy, other operations are discarded, copy regions are ignored.Added in version 1.20.
- Parameters:
name – the name of the
Meta
implementationtags – tags for
api
transform_func – a
MetaTransformFunction
user_data – user data passed to
transform_func
- register_custom_simple(name: str) MetaInfo
Simplified version of
register_custom()
, with no tags and no transform function.Added in version 1.24.
- Parameters:
name – the name of the
Meta
implementation
- serialize(data: ByteArrayInterface) bool
Serialize
meta
into a format that can be stored or transmitted and later deserialized bydeserialize()
.This is only supported for meta that implements
MetaInfo
.serialize_func,False
is returned otherwise.Upon failure,
data
->data pointer could have been reallocated, butdata
->len won’t be modified. This is intended to be able to append multiple metas into the sameGByteArray
.Since serialization size is often the same for every buffer, caller may want to remember the size of previous data to preallocate the next.
Added in version 1.24.
- Parameters:
data –
ByteArrayInterface
to append serialization data
- serialize_simple(data: Sequence[int]) bool
Same as
serialize()
but with aGByteArray
instead ofByteArrayInterface
.Added in version 1.24.
- Parameters:
data –
GByteArray
to append serialization data