/usr/share/pyshared/glitch/gst/videoloop.py is in python-glitch 0.6-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | "Play a video file in a loop."
import gobject
import gst
from glitch.gst import VideoFileTexture
class VideoLoop(VideoFileTexture):
"Play a video file in a loop."
def __init__(self, *args, **kwargs):
VideoFileTexture.__init__(self, *args, **kwargs)
appsink = self.bin.get_by_name('appsink')
pad = appsink.get_static_pad('sink')
pad.add_event_probe(self._event)
def _event(self, pad, event):
if event.type == gst.EVENT_EOS:
gobject.idle_add(self._reset)
return True
def _reset(self):
self.bin.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, 0)
return False
|