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

Method seek

old_examples/play.py:74–89  ·  view source on GitHub ↗

@param location: time to seek to, in nanoseconds

(self, location)

Source from the content-addressed store, hash-verified

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

Callers 5

on_eosMethod · 0.45
do_createMethod · 0.45
__seekMethod · 0.45
sink_seekMethod · 0.45

Calls 1

errorMethod · 0.80

Tested by 1

sink_seekMethod · 0.36