Gst.Buffer.new_allocate

function new_allocate(allocator:Gst.Allocator, size:gsize, params:Gst.AllocationParams):Gst.Buffer {
    // Gjs wrapper for gst_buffer_new_allocate()
}

Tries to create a newly allocated buffer with data of the given size and extra parameters from allocator. If the requested amount of memory can't be allocated, NULL will be returned. The allocated buffer memory is not cleared.

When allocator is NULL, the default memory allocator will be used.

Note that when size == 0, the buffer will not have memory associated with it.

MT safe.

allocator

the Gst.Allocator to use, or NULL to use the default allocator

size

the size in bytes of the new buffer's data.

params

optional parameters

Returns

a new Gst.Buffer, or NULL if the memory couldn't be allocated.