Class (GI Struct)

GstVideo-1.0GstVideoVideoMeta

Extra buffer metadata describing image properties

This meta can also be used by downstream elements to specifiy their buffer layout requirements for upstream. Upstream should try to fit those requirements, if possible, in order to prevent buffer copies.

This is done by passing a custom Gst.Structure to gst_query_add_allocation_meta() when handling the ALLOCATION query. This structure should be named 'video-meta' and can have the following fields:

  • padding-top (uint): extra pixels on the top
  • padding-bottom (uint): extra pixels on the bottom
  • padding-left (uint): extra pixels on the left side
  • padding-right (uint): extra pixels on the right side
  • stride-align0 (uint): stride align requirements for plane 0
  • stride-align1 (uint): stride align requirements for plane 1
  • stride-align2 (uint): stride align requirements for plane 2
  • stride-align3 (uint): stride align requirements for plane 3 The padding and stride-align fields have the same semantic as GstVideo.VideoMeta.alignment and so represent the paddings and stride-align requested on produced video buffers.

Since 1.24 it can be serialized using gst_meta_serialize() and gst_meta_deserialize().

Index
alignment: VideoAlignment
height: number
id: number
n_planes: number
offset: number[]
stride: number[]
width: number
$gtype: GType<VideoMeta>
  • Compute the padded height of each plane from meta (padded size divided by stride).

    It is not valid to call this function with a meta associated to a TILED video format.

    Returns [boolean, number[]]

    true if meta's alignment is valid and plane_height has been updated, false otherwise

    1.18

  • Compute the size, in bytes, of each video plane described in meta including any padding and alignment constraint defined in meta->alignment.

    Returns [boolean, number[]]

    true if meta's alignment is valid and plane_size has been updated, false otherwise

    1.18

  • Map the video plane with index plane in meta and return a pointer to the first byte of the plane and the stride of the plane.

    Parameters

    Returns [boolean, null, number]

    TRUE if the map operation was successful.

  • Set the alignment of meta to alignment. This function checks that the paddings defined in alignment are compatible with the strides defined in meta and will fail to update if they are not.

    Parameters

    Returns boolean

    true if alignment's meta has been updated, false if not

    1.18

    since 1.28: Use gst_video_meta_set_alignment_full() instead

  • Set the alignment of meta to alignment. This function checks that the paddings defined in alignment are compatible with the strides defined in meta and will fail to update if they are not.

    Parameters

    Returns boolean

    true if alignment's meta has been updated, false if not

    1.28