Adapter.map

Gets the first size bytes stored in the adapter. The returned pointer is valid until the next function is called on the adapter.

Note that setting the returned pointer as the data of a gstreamer.Buffer is incorrect for general-purpose plugins. The reason is that if a downstream element stores the buffer so that it has access to it outside of the bounds of its chain function, the buffer will have an invalid data pointer after your element flushes the bytes. In that case you should use Adapter.take, which returns a freshly-allocated buffer that you can set as gstreamer.Buffer memory or the potentially more performant Adapter.takeBuffer.

Returns NULL if size bytes are not available.

class Adapter
ubyte[]
map
(
size_t size
)

Parameters

size size_t

the number of bytes to map/peek

Return Value

Type: ubyte[]

a pointer to the first size bytes of data, or NULL