PadGetRangeFunction


Description:

[ CCode ( has_target = false ) ]
public delegate FlowReturn PadGetRangeFunction (Pad pad, Object? parent, uint64 offset, uint length, Buffer buffer)

This function will be called on source pads when a peer element request a buffer at the specified offset and length .

If this function returns OK, the result buffer will be stored in buffer . The contents of buffer is 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 activate_mode with the PULL.

offset and length are always given in byte units. offset must normally be a value between 0 and the length in bytes of the data available on pad. The length (duration in bytes) can be retrieved with a DURATION or with a SEEKING.

Any offset larger or equal than the length will make the function return EOS, which corresponds to EOS. In this case buffer does not contain a valid buffer.

The buffer size of buffer will only be smaller than length when offset is near the end of the stream. In all other cases, the size of buffer must be exactly the requested size.

It is allowed to call this function with a 0 length and valid offset, in which case buffer will contain a 0-sized buffer and the function returns OK.

When this function is called with a -1 offset, the sequentially next buffer of length length in the stream is returned.

When this function is called with a -1 length, a buffer with a default optimal length is returned in buffer. The length might depend on the value of offset.

Parameters:

pad

the src Pad to perform the getrange on.

parent

the parent of pad. If the NEED_PARENT flag is set, parent is guaranteed to be not-%NULL and remain valid during the execution of this function.

offset

the offset of the range

length

the length of the range

buffer

a memory location to hold the result buffer, cannot be null.

Returns:

OK for success and a valid buffer in buffer. Any other return value leaves buffer undefined.


Namespace: Gst
Package: gstreamer-1.0



2022 vala-language.org