Gst.Segment.prototype.to_stream_time

function to_stream_time(format:Gst.Format, position:Number):Number {
    // Gjs wrapper for gst_segment_to_stream_time()
}

Translate position to stream time using the currently configured segment. The position value must be between segment start and stop value.

This function is typically used by elements that need to operate on the stream time of the buffers it receives, such as effect plugins. In those use cases, position is typically the buffer timestamp or clock time that one wants to convert to the stream time. The stream time is always between 0 and the total duration of the media stream.

format

the format of the segment.

position

the position in the segment

Returns

the position in stream_time or -1 when an invalid position was given.