the src #GstPad to perform the getrange on.
the parent of pad
. If the #GST_PAD_FLAG_NEED_PARENT flag is set, parent
is guaranteed to be not-%NULL and remain valid during the execution of this function.
the offset of the range
the length of the range
a memory location to hold the result buffer, cannot be %NULL.
This function will be called on source pads when a peer element request a buffer at the specified
offset
andlength
. If this function returns #GST_FLOW_OK, the result buffer will be stored inbuffer
. The contents ofbuffer
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 gst_pad_activate_mode() with the #GST_PAD_MODE_PULL.
offset
andlength
are always given in byte units.offset
must 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 a #GST_QUERY_DURATION or with a #GST_QUERY_SEEKING.Any
offset
larger or equal than the length will make the function return #GST_FLOW_EOS, which corresponds to EOS. In this casebuffer
does not contain a valid buffer.The buffer size of
buffer
will only be smaller thanlength
whenoffset
is near the end of the stream. In all other cases, the size ofbuffer
must be exactly the requested size.It is allowed to call this function with a 0
length
and validoffset,
in which casebuffer
will contain a 0-sized buffer and the function returns #GST_FLOW_OK.When this function is called with a -1
offset,
the sequentially next buffer of lengthlength
in 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
.