Add Element.SeekPosition

The method calls the C function gst_element_seek_simple to make the
stream playing at the given time (in nanoseconds). It is useful to start
the stream at a certain time, rewind, etc.
This commit is contained in:
Patrice Ferlet
2023-10-05 22:00:37 +02:00
parent ab1fffcad6
commit 42e1b52ef4

View File

@@ -592,3 +592,9 @@ func (e *Element) GetBaseTime() ClockTime {
return ClockTime(ctime)
}
// SeekPosition seeks to the given position in the stream. The element should be in the PAUSED or PLAYING state and must be a seekable.
// The position is given in nanoseconds.
func (e *Element) SeekPosition(position int64) {
C.gst_element_seek_simple(e.Instance(), C.GstFormat(C.GST_FORMAT_TIME), C.GstSeekFlags(C.GST_SEEK_FLAG_FLUSH), C.gint64(position))
}