Class Allocator
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
Allocator.AllocatorImpl
null
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 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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
TheGstAllocator
is used to create new memory.static class
The AllocatorImpl type represents a native instance of the abstract Allocator class.static class
Allocator.Builder<B extends Allocator.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.GstObject
GstObject.DeepNotifyCallback, GstObject.ObjectClass, GstObject.ObjectImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback
-
Constructor Summary
ConstructorDescriptionAllocator
(MemorySegment address) Create a Allocator proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionalloc
(long size, @Nullable AllocationParams params) Use this Allocator to allocate a new memory block with memory that is at leastsize
big.protected Allocator
asParent()
Returns this instance as if it were its parent type.static Allocator.Builder
<? extends Allocator.Builder> builder()
AAllocator.Builder
object constructs aAllocator
with the specified properties.static Allocator
Find a previously registered allocator withname
.void
Freememory
that was previously allocated with gst_allocator_alloc().static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the Allocator classstatic void
Registers the memoryallocator
withname
.void
Set the default allocator.Methods inherited from class org.freedesktop.gstreamer.gst.GstObject
addControlBinding, checkUniqueness, deepNotify, defaultDeepNotify, defaultError, emitDeepNotify, getControlBinding, getControlRate, getGValueArray, getName, getParent, getPathString, getValue, getValueArray, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, onDeepNotify, ref, refSink, removeControlBinding, replace, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setName, setParent, suggestNextSync, syncValues, unparent, unref
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Allocator
Create a Allocator proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
find
-
register
-
alloc
Use this Allocator to allocate a new memory block with memory that is at leastsize
big.The optional
params
can specify the prefix and padding for the memory. Ifnull
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_MEMORY_FLAG_ZERO_PREFIXED
andGST_MEMORY_FLAG_ZERO_PADDED
respectively.When this Allocator is
null
, the default allocator will be used.The alignment in
params
is given as a bitmask so thatalign
+ 1 equals the amount of bytes to align to. For example, to align to 8 bytes, use an alignment of 7.- Parameters:
size
- size of the visible memory areaparams
- optional parameters- Returns:
- a new
GstMemory
.
-
free
Freememory
that was previously allocated with gst_allocator_alloc().- Parameters:
memory
- the memory to free
-
setDefault
public void setDefault()Set the default allocator. -
builder
AAllocator.Builder
object constructs aAllocator
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAllocator.Builder.build()
.
-