mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-22 15:30:11 +08:00
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:
@@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user