summaryrefslogtreecommitdiffstats
path: root/Demo/sgi
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-09-04 13:26:59 (GMT)
committerGuido van Rossum <guido@python.org>1992-09-04 13:26:59 (GMT)
commit32517f942713a320a6a0b1ca9aeb59b4e4ec0989 (patch)
tree7a8586839673a6ddc1bed5823a73e058e90c432b /Demo/sgi
parent94472a0374f68fc7c746671eb87dc32253b02f05 (diff)
downloadcpython-32517f942713a320a6a0b1ca9aeb59b4e4ec0989.zip
cpython-32517f942713a320a6a0b1ca9aeb59b4e4ec0989.tar.gz
cpython-32517f942713a320a6a0b1ca9aeb59b4e4ec0989.tar.bz2
Remove PAL dependencies; add -w option (initial window width);
add stepunit(8, 6) call.
Diffstat (limited to 'Demo/sgi')
-rwxr-xr-xDemo/sgi/video/Vrec.py43
1 files changed, 30 insertions, 13 deletions
diff --git a/Demo/sgi/video/Vrec.py b/Demo/sgi/video/Vrec.py
index 2e20086..5f6cf6e 100755
--- a/Demo/sgi/video/Vrec.py
+++ b/Demo/sgi/video/Vrec.py
@@ -6,14 +6,15 @@
# Usage:
#
-# makemovie [-a] [-q queuesize] [-r n/d] [moviefile [audiofile]]
+# makemovie [-a] [-q queuesize] [-r rate] [-w width] [moviefile [audiofile]]
# Options:
#
# -a : record audio as well
# -q queuesize : set the capture queue size (default 2)
-# -r rate : capture 1 out of every n frames (default and min 2)
+# -r rate : capture 1 out of every 'rate' frames (default and min 2)
+# -w width : initial window width (default interactive placement)
#
# moviefile : here goes the movie data (default film.video);
# the format is documented in cmif-film.ms
@@ -55,8 +56,9 @@ def main():
qsize = 2
audio = 0
rate = 2
+ width = 0
- opts, args = getopt.getopt(sys.argv[1:], 'aq:r:')
+ opts, args = getopt.getopt(sys.argv[1:], 'aq:r:w:')
for opt, arg in opts:
if opt == '-a':
audio = 1
@@ -67,6 +69,8 @@ def main():
if rate < 2:
sys.stderr.write('-r rate must be >= 2\n')
sys.exit(2)
+ elif opt == '-w':
+ width = string.atoi(arg)
if args[2:]:
sys.stderr.write('usage: Vrec [options] [file [audiofile]]\n')
@@ -89,22 +93,35 @@ def main():
else:
audiofilename = None
- gl.foreground()
-
- # XXX should remove PAL dependencies
-
- x, y = SV.PAL_XMAX / 4, SV.PAL_YMAX / 4
- print x, 'x', y
+ v = sv.OpenVideo()
+ # Determine maximum window size based on signal standard
+ param = [SV.BROADCAST, 0]
+ v.GetParam(param)
+ if param[1] == SV.PAL:
+ x = SV.PAL_XMAX
+ y = SV.PAL_YMAX
+ elif param[1] == SV.NTSC:
+ x = SV.NTSC_XMAX
+ y = SV.NTSC_YMAX
+ else:
+ print 'Unknown video standard', param[1]
+ sys.exit(1)
- gl.minsize(40, 30)
+ gl.foreground()
+ gl.maxsize(x, y)
+ gl.keepaspect(x, y)
gl.stepunit(8, 6)
- gl.maxsize(SV.PAL_XMAX, SV.PAL_YMAX)
- gl.keepaspect(SV.PAL_XMAX, SV.PAL_YMAX)
+ if width:
+ gl.prefsize(width, width*3/4)
win = gl.winopen(filename)
+ if width:
+ gl.maxsize(x, y)
+ gl.keepaspect(x, y)
+ gl.stepunit(8, 6)
+ gl.winconstraints()
x, y = gl.getsize()
print x, 'x', y
- v = sv.OpenVideo()
v.SetSize(x, y)
v.BindGLWindow(win, SV.IN_REPLACE)