Gst.Allocator¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gst.Object (27), GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | find(name) | 
| class | register(name, allocator) | 
| alloc(size, params) | |
| free(memory) | |
| set_default() | 
Virtual Methods¶
| Inherited: | Gst.Object (1), GObject.Object (7) | 
|---|
| do_alloc(size, params) | |
| do_free(memory) | 
Properties¶
| Inherited: | Gst.Object (2) | 
|---|
Signals¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
Fields¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| mem_copy | Gst.MemoryCopyFunction | r | the implementation of the Gst.MemoryCopyFunction | 
| mem_is_span | Gst.MemoryIsSpanFunction | r | the implementation of the Gst.MemoryIsSpanFunction | 
| mem_map | Gst.MemoryMapFunction | r | the implementation of the Gst.MemoryMapFunction | 
| mem_map_full | Gst.MemoryMapFullFunction | r | the implementation of the Gst.MemoryMapFullFunction. Will be used instead of mem_map if present. | 
| mem_share | Gst.MemoryShareFunction | r | the implementation of the Gst.MemoryShareFunction | 
| mem_type | str | r | |
| mem_unmap | Gst.MemoryUnmapFunction | r | the implementation of the Gst.MemoryUnmapFunction | 
| mem_unmap_full | Gst.MemoryUnmapFullFunction | r | the implementation of the Gst.MemoryUnmapFullFunction. Will be used instead of mem_unmap if present. | 
| object | Gst.Object | r | 
Class Details¶
- 
class Gst.Allocator(**kwargs)¶
- Bases: - Gst.Object- Abstract: - Yes - Structure: - Gst.AllocatorClass- Memory is usually created by allocators with a - Gst.Allocator.alloc() method call. When- Noneis 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 with- Gst.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: - name ( - stror- None) – the name of the allocator- Returns: - a - Gst.Allocatoror- Nonewhen the allocator with name was not registered. Use- Gst.Object.unref() to release the allocator after usage.- Return type: - Gst.Allocatoror- None- 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 allocator
- allocator (Gst.Allocator) –Gst.Allocator
 - Registers the memory allocator with name. This function takes ownership of allocator. 
- name (
 - 
alloc(size, params)[source]¶
- Parameters: - size (int) – size of the visible memory area
- params (Gst.AllocationParamsorNone) – optional parameters
 - Returns: - a new - Gst.Memory.- Return type: - Gst.Memoryor- None- 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 - Noneis 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_PREFIXEDand- Gst.MemoryFlags.ZERO_PADDEDrespectively.- 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. 
- size (
 - 
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 area
- params (Gst.AllocationParamsorNone) – optional parameters
 - Returns: - a new - Gst.Memory.- Return type: - Gst.Memoryor- None- 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 - Noneis 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_PREFIXEDand- Gst.MemoryFlags.ZERO_PADDEDrespectively.- 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. 
- size (
 - 
do_free(memory) virtual¶
- Parameters: - memory ( - Gst.Memory) – the memory to free- Free memory that was previously allocated with - Gst.Allocator.alloc().
 
- 
classmethod