Class Allocator
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
Allocator.Allocator$Impl
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
Nested ClassesModifier and TypeClassDescriptionstatic classThe Allocator$Impl type represents a native instance of the abstract Allocator class.static classTheGstAllocatoris used to create new memory.static classAllocator.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.Object$Impl, GstObject.ObjectClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Allocator.Allocator(MemorySegment address) Create a Allocator proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescription@Nullable Memoryalloc(long size, @Nullable AllocationParams params) Use this Allocator to allocate a new memory block with memory that is at leastsizebig.protected AllocatorasParent()Returns this instance as if it were its parent type.static @Nullable AllocatorFind a previously registered allocator withname.Whennameisnull, the default allocator will be returned.voidFreememorythat was previously allocated with gst_allocator_alloc().static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the Allocator classstatic voidRegisters the memoryallocatorwithname.voidSet 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, unrefMethods inherited from class org.gnome.gobject.InitiallyUnowned
builderMethods 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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
-
Allocator
public Allocator()Creates a new Allocator.
-
-
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 Javasuperkeyword, 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 leastsizebig.The optional
paramscan specify the prefix and padding for the memory. Ifnullis 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_PREFIXEDandGST_MEMORY_FLAG_ZERO_PADDEDrespectively.When this Allocator is
null, the default allocator will be used.The alignment in
paramsis 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
Freememorythat was previously allocated with gst_allocator_alloc().- Parameters:
memory- the memory to free
-
setDefault
public void setDefault()Set the default allocator.
-