Segment.clip

bool clip(gst.types.Format format, ulong start, ulong stop, out ulong clipStart, out ulong clipStop)

Clip the given start and stop values to the segment boundaries given in segment. start and stop are compared and clipped to segment start and stop values.

If the function returns false, start and stop are known to fall outside of segment and clip_start and clip_stop are not updated.

When the function returns true, clip_start and clip_stop will be updated. If clip_start or clip_stop are different from start or stop respectively, the region fell partially in the segment.

Note that when stop is -1, clip_stop will be set to the end of the segment. Depending on the use case, this may or may not be what you want.

Parameters

formatthe format of the segment.
startthe start position in the segment
stopthe stop position in the segment
clipStartthe clipped start position in the segment
clipStopthe clipped stop position in the segment

Returns

true if the given start and stop times fall partially or

completely in segment, false if the values are completely outside of the segment.