Gst.Allocator¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
mem_copy |
r |
the implementation of the |
|
mem_is_span |
r |
the implementation of the |
|
mem_map |
r |
the implementation of the |
|
mem_map_full |
r |
the implementation of the |
|
mem_share |
r |
the implementation of the |
|
mem_type |
r |
||
mem_unmap |
r |
the implementation of the |
|
mem_unmap_full |
r |
the implementation of the |
|
object |
r |
Class Details¶
- class Gst.Allocator(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Memory is usually created by allocators with a
Gst.Allocator.alloc
() method call. WhenNone
is used as the allocator, the default allocator will be used.New allocators can be registered with
Gst.Allocator.register
(). Allocators are identified by name and can be retrieved withGst.Allocator.find
().Gst.Allocator.set_default
() can be used to change the default allocator.New memory can be created with
Gst.Memory.new_wrapped
() that wraps the memory allocated elsewhere.- classmethod find(name)[source]¶
- Parameters:
- Returns:
a
Gst.Allocator
orNone
when the allocator with name was not registered.- Return type:
Find a previously registered allocator with name. When name is
None
, the default allocator will be returned.
- classmethod register(name, allocator)[source]¶
- Parameters:
name (
str
) – the name of the allocatorallocator (
Gst.Allocator
) –Gst.Allocator
Registers the memory allocator with name.
- alloc(size, params)[source]¶
- Parameters:
size (
int
) – size of the visible memory areaparams (
Gst.AllocationParams
orNone
) – optional parameters
- Returns:
a new
Gst.Memory
.- Return type:
Gst.Memory
orNone
Use self to allocate a new memory block with memory that is at least size big.
The optional params can specify the prefix and padding for the memory. If
None
is passed, no flags, no extra prefix/padding and a default alignment is used.The prefix/padding will be filled with 0 if flags contains
Gst.MemoryFlags.ZERO_PREFIXED
andGst.MemoryFlags.ZERO_PADDED
respectively.When self is
None
, the default allocator will be used.The alignment in params is given as a bitmask so that align + 1 equals the amount of bytes to align to. For example, to align to 8 bytes, use an alignment of 7.
- free(memory)[source]¶
- Parameters:
memory (
Gst.Memory
) – the memory to free
Free memory that was previously allocated with
Gst.Allocator.alloc
().
- do_alloc(size, params) virtual¶
- Parameters:
size (
int
) – size of the visible memory areaparams (
Gst.AllocationParams
orNone
) – optional parameters
- Returns:
a new
Gst.Memory
.- Return type:
Gst.Memory
orNone
Use allocator to allocate a new memory block with memory that is at least size big.
The optional params can specify the prefix and padding for the memory. If
None
is passed, no flags, no extra prefix/padding and a default alignment is used.The prefix/padding will be filled with 0 if flags contains
Gst.MemoryFlags.ZERO_PREFIXED
andGst.MemoryFlags.ZERO_PADDED
respectively.When allocator is
None
, the default allocator will be used.The alignment in params is given as a bitmask so that align + 1 equals the amount of bytes to align to. For example, to align to 8 bytes, use an alignment of 7.
- do_free(memory) virtual¶
- Parameters:
memory (
Gst.Memory
) – the memory to free
Free memory that was previously allocated with
Gst.Allocator.alloc
().