MCPcopy Create free account
hub / github.com/GStreamer/gst-python / seek

Method seek

old_examples/synchronizer.py:77–92  ·  view source on GitHub ↗

@param location: time to seek to, in nanoseconds

(self, location)

Source from the content-addressed store, hash-verified

75 return (position, duration)
76
77 def seek(self, location):
78 """
79 @param location: time to seek to, in nanoseconds
80 """
81 gst.debug("seeking to %r" % location)
82 event = gst.event_new_seek(1.0, gst.FORMAT_TIME,
83 gst.SEEK_FLAG_FLUSH,
84 gst.SEEK_TYPE_SET, location,
85 gst.SEEK_TYPE_NONE, 0)
86
87 res = self.player.send_event(event)
88 if res:
89 gst.info("setting new stream time to 0")
90 self.player.set_new_stream_time(0L)
91 else:
92 gst.error("seek to %r failed" % location)
93
94 def pause(self):
95 gst.info("pausing player")

Callers 3

seek_and_pauseMethod · 0.45
on_eosMethod · 0.45

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected