ShmAllocator

This is a subclass of #GstFdAllocator that implements the gst.allocator.Allocator.alloc method using memfd_create() when available, POSIX shm_open() otherwise. Platforms not supporting any of those (Windows) will always return null.

Note that allocating new shared memories has a significant performance cost, it is thus recommended to keep a pool of pre-allocated #GstMemory, using #GstBufferPool. For that reason, this allocator has the gst.types.AllocatorFlags.NoCopy flag set.

Members

Static functions

get
gst.allocator.Allocator get()

Get the #GstShmAllocator singleton previously registered with gstallocators.shm_allocator.ShmAllocator.initOnce.

initOnce
void initOnce()

Register a #GstShmAllocator using gst.allocator.Allocator.register with the name GST_ALLOCATOR_SHM. This is no-op after the first call.

Inherited Members

From FdAllocator

alloc
gst.memory.Memory alloc(gst.allocator.Allocator allocator, int fd, size_t size, gstallocators.types.FdMemoryFlags flags)

Return a gst.memory.Memory that wraps a generic file descriptor.