buffer_add_audio_meta


Description:

[ CCode ( cname = "gst_buffer_add_audio_meta" ) ]
[ Version ( since = "1.16" ) ]
public unowned Meta? buffer_add_audio_meta (Buffer buffer, Info info, size_t samples, size_t? offsets)

Allocates and attaches a Meta on buffer, which must be writable for that purpose.

The fields of the Meta are directly populated from the arguments of this function.

When info.layout is NON_INTERLEAVED and offsets is null, the offsets are calculated with a formula that assumes the planes are tightly packed and in sequence: offsets[channel] = channel * samples * sample_stride

It is not allowed for channels to overlap in memory, i.e. for each i in [0, channels), the range [offsets[i], offsets [i] + samples * sample_stride) 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.

Parameters:

buffer

a Buffer

info

the audio properties of the buffer

samples

the number of valid samples in the buffer

offsets

the offsets (in bytes) where each channel plane starts in the buffer or null to calculate it (see below); must be null also when info.layout is INTERLEAVED

Returns:

the Meta that was attached on the buffer


Namespace: Gst.Audio



2022 vala-language.org