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 #GstBuffer 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 gst_adapter_take(), which returns a freshly-allocated buffer that you can set as #GstBuffer memory or the potentially more performant gst_adapter_take_buffer().

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

Meta