From b2c553fd364b006d5f1c86a4a76759606862a5e1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 19 Jan 2009 10:43:30 +1100 Subject: [PATCH] use _frames for frame cache --- bin/oxframe | 2 +- oxgst/video.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/oxframe b/bin/oxframe index 9da3409..25812d0 100755 --- a/bin/oxframe +++ b/bin/oxframe @@ -26,7 +26,7 @@ if __name__ == '__main__': parser = OptionParser() parser.add_option('-x', '--width', dest='width', help='scale image to given width') parser.add_option('-y', '--height', dest='height', help='scale image to given height') - parser.add_option('-p', '--pos', dest='pos', help='frame position in milliseconds') + parser.add_option('-p', '--pos', dest='pos', help='frame position in seconds, float') parser.add_option('-i', '--input', dest='input', help='video input') parser.add_option('-o', '--output', dest='output', help='path to save frame to, jpg, png supported') (opts, args) = parser.parse_args() diff --git a/oxgst/video.py b/oxgst/video.py index be92794..0c70f57 100644 --- a/oxgst/video.py +++ b/oxgst/video.py @@ -25,7 +25,7 @@ class Video(gst.Pipeline): # queue callbacks self.callback = {} # extracted frames - self.frames = {} + self._frames = {} # true only if we are prerolled self._ready = False @@ -119,13 +119,13 @@ class Video(gst.Pipeline): def frame(self, timestamp): mainloop = gobject.MainLoop() - self.frames[timestamp] = None + self._frames[timestamp] = None def callback(frame, timestamp): - self.frames[timestamp] = frame + self._frames[timestamp] = frame mainloop.quit() if self.getFrame(timestamp, callback): mainloop.run() - frame = self.frames[timestamp] - del self.frames[timestamp] + frame = self._frames[timestamp] + del self._frames[timestamp] return frame