Gst.Meta¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
flags |
r/w |
extra flags for the metadata |
|
info |
r/w |
pointer to the |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
Details¶
- class Gst.Meta¶
The
Gst.Metastructure should be included as the first member of aGst.Buffermetadata 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
Gst.Meta.api_type_register() which takes a name for the metadata API and some tags associated with the metadata. WithGst.Meta.api_type_has_tag() 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
Gst.MetaInfostructure that contains the information for the implementation of the API.A specific implementation can be retrieved by name with
Gst.Meta.get_info().See
Gst.Bufferfor how the metadata can be added, retrieved and removed from buffers.- classmethod api_type_aggregate_params(api, aggregated_params, params0, params1)[source]¶
- Parameters:
api (
GObject.GType) – theGObject.GTypeof the API for which the parameters are being aggregated.aggregated_params (
Gst.Structure) – This structure will be updated with the combined parameters from both params0 and params1.params0 (
Gst.Structure) – aGst.Structurecontaining the new parameters to be aggregated.params1 (
Gst.Structure) – aGst.Structurecontaining the new parameters to be aggregated.
- Returns:
Trueif the parameters were successfully aggregated,Falseotherwise.- Return type:
When a element like
teedecides the allocation, each downstream element may fill different parameters and pass them toGst.Query.add_allocation_meta(). In order to keep these parameters, a merge operation is needed. This aggregate function can combine the parameters from params0 and param1, and write the result back into aggregated_params.New in version 1.26.
- classmethod api_type_get_tags(api)[source]¶
- Parameters:
api (
GObject.GType) – an API- Returns:
an array of tags as strings.
- Return type:
[
str]
New in version 1.2.
- classmethod api_type_has_tag(api, tag)[source]¶
- Parameters:
api (
GObject.GType) – an APItag (
int) – the tag to check
- Returns:
Trueif api was registered with tag.- Return type:
Check if api was registered with tag.
- classmethod api_type_register(api, tags)[source]¶
- Parameters:
- Returns:
a unique
GObject.GTypefor api.- Return type:
Register and return a
GObject.GTypefor the api and associate it with tags.
- classmethod api_type_set_params_aggregator(api, aggregator)[source]¶
- Parameters:
api (
GObject.GType) – theGObject.GTypeof the API for which the aggregator function is being set.aggregator (
Gst.AllocationMetaParamsAggregator) – the aggregator function to be associated with the given API type.
This function sets the aggregator function for a specific API type.
New in version 1.26.
- classmethod deserialize(buffer, data, size)[source]¶
- Parameters:
buffer (
Gst.Buffer) – aGst.Bufferdata (
int) – serialization data obtained fromGst.Meta.serialize()size (
int) – size of data
- Returns:
the metadata owned by buffer, or
None.- consumed:
total size used by this meta, could be less than size
- Return type:
Recreate a
Gst.Metafrom serialized data returned byGst.Meta.serialize() 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.
New in version 1.24.
- classmethod get_info(impl)[source]¶
- Parameters:
impl (
str) – the name- Returns:
a
Gst.MetaInfowith impl, orNonewhen no such metainfo exists.- Return type:
Gst.MetaInfoorNone
Lookup a previously registered meta info structure by its implementation name impl.
- classmethod register_custom(name, tags, transform_func, *user_data)[source]¶
- Parameters:
tags ([
str]) – tags for apitransform_func (
Gst.CustomMetaTransformFunctionorNone) – aGst.MetaTransformFunctionuser_data (
objectorNone) – user data passed to transform_func
- Returns:
a
Gst.MetaInfothat can be used to access metadata.- Return type:
Register a new custom
Gst.Metaimplementation, backed by an opaque structure holding aGst.Structure.The registered info can be retrieved later with
Gst.Meta.get_info() by using name as the key.The backing
Gst.Structurecan be retrieved withGst.CustomMeta.get_structure(), its mutability is conditioned by the writability of the buffer the meta is attached to.When transform_func is
None, the meta and its backingGst.Structurewill always be copied when the transform operation is copy, other operations are discarded, copy regions are ignored.New in version 1.20.
- classmethod register_custom_simple(name)[source]¶
- Parameters:
- Returns:
a
Gst.MetaInfothat can be used to access metadata.- Return type:
Simplified version of
Gst.Meta.register_custom(), with no tags and no transform function.New in version 1.24.
- compare_seqnum(meta2)[source]¶
- Parameters:
- Returns:
a negative number if self comes before meta2, 0 if both metas have an equal sequence number, or a positive integer if self comes after meta2.
- Return type:
Meta sequence number compare function. Can be used as
GLib.CompareFuncor aGLib.CompareDataFunc.New in version 1.16.
- serialize(data)[source]¶
- Parameters:
data (
Gst.ByteArrayInterface) –Gst.ByteArrayInterfaceto append serialization data- Returns:
- Return type:
Serialize self into a format that can be stored or transmitted and later deserialized by
Gst.Meta.deserialize().This is only supported for meta that implements Gst.MetaInfo.serialize_func,
Falseis 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
GLib.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.
New in version 1.24.
- serialize_simple(data)[source]¶
- Parameters:
data (
bytes) –GLib.ByteArrayto append serialization data- Returns:
- Return type:
Same as
Gst.Meta.serialize() but with aGLib.ByteArrayinstead ofGst.ByteArrayInterface.New in version 1.24.