map


Description:

public bool map (Info info, Buffer gstbuffer, MapFlags flags)

Maps an audio gstbuffer so that it can be read or written and stores the result of the map operation in buffer.

This is especially useful when the gstbuffer is in non-interleaved (planar) layout, in which case this function will use the information in the gstbuffer's attached Meta in order to map each channel in a separate "plane" in Buffer. If a Meta is not attached on the gstbuffer, then it must be in interleaved layout.

If a Meta is attached, then the Info on the meta is checked against info. Normally, they should be equal, but in case they are not, a g_critical will be printed and the Info from the meta will be used.

In non-interleaved buffers, it is possible to have each channel on a separate Memory . In this case, each memory will be mapped separately to avoid copying their contents in a larger memory area. Do note though that it is not supported to have a single channel spanning over two or more different Memory objects. Although the map operation will likely succeed in this case, it will be highly sub-optimal and it is recommended to merge all the memories in the buffer before calling this function.

Note: The actual Buffer is not ref'ed, but it is required to stay valid as long as it's mapped.

Parameters:

info

the audio properties of the buffer

gstbuffer

the Buffer to be mapped

flags

the access mode for the memory

buffer

pointer to a Buffer

Returns:

true if the map operation succeeded or false on failure