Ejemplo n.º 1
0
 def snapshot(self):
     """
     returns deferred to the path (which is under snapshotDir()) where
     we saved the image.
     """
     filename = "%s/%s.jpg" % (snapshotDir(), time.time())
     d = defer.Deferred()
     self._snapshotRequests.append((d, filename))
     return d
Ejemplo n.º 2
0
    def __init__(self, liveVideoXid, musicTime, recordingTo):
        self.musicTime = musicTime
        self.liveVideoXid = liveVideoXid
        self.recordingTo = recordingTo
        self.snapshotRequests = Queue()

        try:
            os.makedirs(snapshotDir())
        except OSError:
            pass
Ejemplo n.º 3
0
 def req(frame):
     filename = "%s/%s.jpg" % (snapshotDir(), time.time())
     log.debug("received snapshot; saving in %s", filename)
     frame.save(filename)
     d.callback(filename)