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 GstAudio.AudioMeta in order to map each channel in a
separate "plane" in GstAudio.AudioBuffer. If a GstAudio.AudioMeta is not attached
on the gstbuffer, then it must be in interleaved layout.
If a GstAudio.AudioMeta is attached, then the GstAudio.AudioInfo 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 GstAudio.AudioInfo from the meta will be
used.
In non-interleaved buffers, it is possible to have each channel on a separate
Gst.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
Gst.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 Gst.Buffer is not ref'ed, but it is required to stay valid
as long as it's mapped.
Maps an audio
gstbufferso that it can be read or written and stores the result of the map operation inbuffer.This is especially useful when the
gstbufferis in non-interleaved (planar) layout, in which case this function will use the information in thegstbuffer's attached GstAudio.AudioMeta in order to map each channel in a separate "plane" in GstAudio.AudioBuffer. If a GstAudio.AudioMeta is not attached on thegstbuffer, then it must be in interleaved layout.If a GstAudio.AudioMeta is attached, then the GstAudio.AudioInfo 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 GstAudio.AudioInfo from the meta will be used.In non-interleaved buffers, it is possible to have each channel on a separate Gst.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 Gst.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 Gst.Buffer is not ref'ed, but it is required to stay valid as long as it's mapped.