Interface MemoryShareFunction
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Generated("org.javagi.JavaGI")
public interface MemoryShareFunction
extends FunctionPointer
Functional interface declaration of the MemoryShareFunction callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSharesizebytes frommemstarting atoffsetand return them wrapped in a new GstMemory object.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, long, long)method.default MemorySegmentupcall(MemorySegment mem, long offset, long size) Theupcallmethod is called from native code.
-
Method Details
-
run
Sharesizebytes frommemstarting atoffsetand return them wrapped in a new GstMemory object. Ifsizeis set to -1, all bytes starting atoffsetare shared. This function does not make a copy of the bytes inmem.- Parameters:
mem- aGstMemoryoffset- an offsetsize- a size or -1- Returns:
- a new
GstMemoryobject sharing the requested region inmem.
-
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(Memory, long, long)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, long, long)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-