Class (GI Struct)

Gst-1.0GstMeta

The Gst.Meta structure should be included as the first member of a Gst.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 gst_meta_api_type_register() which takes a name for the metadata API and some tags associated with the metadata. With gst_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.MetaInfo structure 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.Buffer for how the metadata can be added, retrieved and removed from buffers.

Index

Constructors

Properties

flags: Gst.MetaFlags
$gtype: GType<Meta>

Methods

  • Serialize meta 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, 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 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.

    Parameters

    Returns boolean

    true on success, false otherwise.

  • When a element like tee decides the allocation, each downstream element may fill different parameters and pass them to gst_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.

    Parameters

    • api: GType

      the GType of the API for which the parameters are being aggregated.

    • aggregated_params: Structure

      This structure will be updated with the combined parameters from both params0 and params1.

    • params0: Structure

      a Gst.Structure containing the new parameters to be aggregated.

    • params1: Structure

      a Gst.Structure containing the new parameters to be aggregated.

    Returns boolean

  • Check if api was registered with tag.

    Parameters

    • api: GType

      an API

    • tag: number

      the tag to check

    Returns boolean

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

    Parameters

    • api: string

      an API to register

    • tags: string[]

      tags for api

    Returns GType

  • Recreate a Gst.Meta from serialized data returned by gst_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.

    Parameters

    • buffer: Gst.Buffer
    • data: number

      serialization data obtained from gst_meta_serialize()

    • size: number

      size of data

    Returns [Meta, number]