Gst.Segment.prototype.to_running_time
function to_running_time(format:Gst.Format, position:Number):Number { // Gjs wrapper for gst_segment_to_running_time() }
Translate position to the total running time using the currently configured segment. Position is a value between segment start and stop time.
This function is typically used by elements that need to synchronize to the global clock in a pipeline. The runnning time is a constantly increasing value starting from 0. When Gst.Segment.prototype.init is called, this value will reset to 0.
This function returns -1 if the position is outside of segment start and stop.
- format
the format of the segment.
- position
the position in the segment
- Returns
the position as the total running time or -1 when an invalid position was given.