Function

GstAudio-1.0GstAudiobuffer_add_dsd_plane_offset_metaSince 1.24

  • Allocates and attaches a GstAudio.DsdPlaneOffsetMeta on buffer, which must be writable for that purpose. The fields of the GstAudio.DsdPlaneOffsetMeta are directly populated from the arguments of this function.

    If offsets is NULL, then the meta's offsets field is left uninitialized. This is useful if for example offset values are to be calculated in the meta's offsets field in-place. Similarly, num_bytes_per_channel can be set to 0, but only if offsets is NULL. This is useful if the number of bytes per channel is known only later.

    It is not allowed for channels to overlap in memory, i.e. for each i in [0, channels), the range [offsets[i], offsets[i] + num_bytes_per_channel) must not overlap with any other such range. This function will assert if the parameters specified cause this restriction to be violated.

    It is, obviously, also not allowed to specify parameters that would cause out-of-bounds memory access on buffer. This is also checked, which means that you must add enough memory on the buffer before adding this meta.

    This meta is only needed for non-interleaved (= planar) DSD data.

    Parameters

    • buffer: Gst.Buffer
    • num_bytes_per_channel: number | bigint

      Number of bytes per channel

    • offsets: (number | bigint)[]

      the offsets (in bytes) where each channel plane starts in the buffer

    Returns DsdPlaneOffsetMeta

    the GstAudio.DsdPlaneOffsetMeta that was attached on the buffer

    1.24