GstAllocators.ShmAllocator

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Allocator Gst.Allocator GstAllocators.FdAllocator GstAllocators.FdAllocator Gst.Allocator->GstAllocators.FdAllocator Gst.Object->Gst.Allocator GstAllocators.ShmAllocator GstAllocators.ShmAllocator GstAllocators.FdAllocator->GstAllocators.ShmAllocator

Subclasses:

None

Methods

Inherited:

GstAllocators.FdAllocator (2), Gst.Allocator (5), Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get ()

class

init_once ()

Virtual Methods

Inherited:

Gst.Allocator (2), Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Class Details

class GstAllocators.ShmAllocator(**kwargs)
Bases:

GstAllocators.FdAllocator

Abstract:

No

Structure:

GstAllocators.ShmAllocatorClass

This is a subclass of GstAllocators.FdAllocator that implements the Gst.Allocator.alloc() method using memfd_create() when available, POSIX shm_open() otherwise. Platforms not supporting any of those (Windows) will always return None.

Note that allocating new shared memories has a significant performance cost, it is thus recommended to keep a pool of pre-allocated Gst.Memory, using Gst.BufferPool. For that reason, this allocator has the Gst.AllocatorFlags.NO_COPY flag set.

New in version 1.24.

classmethod get()[source]
Returns:

a Gst.Allocator or None if GstAllocators.ShmAllocator.init_once() has not been previously called.

Return type:

Gst.Allocator or None

Get the GstAllocators.ShmAllocator singleton previously registered with GstAllocators.ShmAllocator.init_once().

New in version 1.24.

classmethod init_once()[source]

Register a GstAllocators.ShmAllocator using Gst.Allocator.register() with the name GstAllocators.ALLOCATOR_SHM. This is no-op after the first call.

New in version 1.24.