Interface PadGetRangeFunction
- 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.
PadGetRangeFunction callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionThis function will be called on source pads when a peer element request a buffer at the specifiedoffsetandlength.If this function returnsGST_FLOW_OK, the result buffer will be stored inbuffer.The contents ofbufferis invalid for any other return value.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, long, int, java.lang.foreign.MemorySegment)method.default intupcall(MemorySegment pad, MemorySegment parent, long offset, int length, MemorySegment buffer) Theupcallmethod is called from native code.
-
Method Details
-
run
This function will be called on source pads when a peer element request a buffer at the specifiedoffsetandlength.If this function returnsGST_FLOW_OK, the result buffer will be stored inbuffer.The contents ofbufferis invalid for any other return value.This function is installed on a source pad with gst_pad_set_getrange_function() and can only be called on source pads after they are successfully activated with gst_pad_activate_mode() with the
GST_PAD_MODE_PULL.offsetandlengthare always given in byte units.offsetmust normally be a value between 0 and the length in bytes of the data available onpad.The length (duration in bytes) can be retrieved with aGST_QUERY_DURATIONor with aGST_QUERY_SEEKING.Any
offsetlarger or equal than the length will make the function returnGST_FLOW_EOS, which corresponds to EOS. In this casebufferdoes not contain a valid buffer.The buffer size of
bufferwill only be smaller thanlengthwhenoffsetis near the end of the stream. In all other cases, the size ofbuffermust be exactly the requested size.It is allowed to call this function with a 0
lengthand validoffset,in which casebufferwill contain a 0-sized buffer and the function returnsGST_FLOW_OK.When this function is called with a -1
offset,the sequentially next buffer of lengthlengthin the stream is returned.When this function is called with a -1
length,a buffer with a default optimal length is returned inbuffer.The length might depend on the value ofoffset. -
upcall
default int upcall(MemorySegment pad, MemorySegment parent, long offset, int length, MemorySegment buffer) Theupcallmethod is called from native code. The parameters are marshaled andrun(org.freedesktop.gstreamer.gst.Pad, org.freedesktop.gstreamer.gst.GstObject, long, int, org.freedesktop.gstreamer.gst.Buffer[])is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, long, int, java.lang.foreign.MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-