summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-08-18 14:16:12 (GMT)
committerGuido van Rossum <guido@python.org>1992-08-18 14:16:12 (GMT)
commit843d153f996882fe24884a34f98ca97b176ff6ee (patch)
treeebaadae996dc1a20fd3dea715fdaadad59d2d065
parentf9f2e82fcade2d44a69bbdac1ba59bdf591743f4 (diff)
downloadcpython-843d153f996882fe24884a34f98ca97b176ff6ee.zip
cpython-843d153f996882fe24884a34f98ca97b176ff6ee.tar.gz
cpython-843d153f996882fe24884a34f98ca97b176ff6ee.tar.bz2
Initial revision
-rwxr-xr-xDemo/sgi/video/Vinfo.py38
-rwxr-xr-xDemo/sgi/video/Vplay.py57
2 files changed, 95 insertions, 0 deletions
diff --git a/Demo/sgi/video/Vinfo.py b/Demo/sgi/video/Vinfo.py
new file mode 100755
index 0000000..3293e41
--- /dev/null
+++ b/Demo/sgi/video/Vinfo.py
@@ -0,0 +1,38 @@
+import sys
+import VFile
+
+def main():
+ if sys.argv[1:]:
+ for filename in sys.argv[1:]:
+ process(filename)
+ else:
+ process('film.video')
+
+def process(filename):
+ vin = VFile.VinFile().init(filename)
+ print 'File: ', filename
+ print 'Version: ', vin.version
+ print 'Size: ', vin.width, 'x', vin.height
+ print 'Pack: ', vin.packfactor, '; chrom:', vin.chrompack
+ print 'Bits: ', vin.c0bits, vin.c1bits, vin.c2bits
+ print 'Format: ', vin.format
+ print 'Offset: ', vin.offset
+ print 'Frame times:',
+ n = 0
+ t = 0
+ while 1:
+ try:
+ t, data, cdata = vin.getnextframe()
+ except EOFError:
+ print
+ break
+ if n%8 == 0:
+ sys.stdout.write('\n')
+ sys.stdout.write('\t' + `t`)
+ n = n+1
+ print 'Total', n, 'frames in', t*0.001, 'sec.',
+ if t:
+ print '-- average', int(n*10000.0/t)*0.1, 'frames/sec',
+ print
+
+main()
diff --git a/Demo/sgi/video/Vplay.py b/Demo/sgi/video/Vplay.py
new file mode 100755
index 0000000..70e9356
--- /dev/null
+++ b/Demo/sgi/video/Vplay.py
@@ -0,0 +1,57 @@
+import sys
+import VFile
+import time
+import gl, GL
+from DEVICE import *
+
+def main():
+ if sys.argv[1:]:
+ for filename in sys.argv[1:]:
+ process(filename)
+ else:
+ process('film.video')
+
+def process(filename):
+ vin = VFile.VinFile().init(filename)
+ print 'File: ', filename
+ print 'Version: ', vin.version
+ print 'Size: ', vin.width, 'x', vin.height
+ print 'Pack: ', vin.packfactor, '; chrom:', vin.chrompack
+ print 'Bits: ', vin.c0bits, vin.c1bits, vin.c2bits
+ print 'Format: ', vin.format
+ print 'Offset: ', vin.offset
+
+ gl.foreground()
+ gl.prefsize(vin.width, vin.height)
+ win = gl.winopen(filename)
+ vin.initcolormap()
+
+ gl.qdevice(ESCKEY)
+ gl.qdevice(WINSHUT)
+ gl.qdevice(WINQUIT)
+
+ t0 = time.millitimer()
+ running = 1
+ data = None
+ while 1:
+ if running:
+ try:
+ t, data, chromdata = vin.getnextframe()
+ except EOFError:
+ running = 0
+ gl.wintitle('(done)')
+ if running:
+ dt = t + t0 - time.millitimer()
+ if dt > 0:
+ time.millisleep(dt)
+ vin.showframe(data, chromdata)
+ if not running or gl.qtest():
+ dev, val = gl.qread()
+ if dev in (ESCKEY, WINSHUT, WINQUIT):
+ break
+ if dev == REDRAW:
+ gl.reshapeviewport()
+ if data:
+ vin.showframe(data, chromdata)
+
+main()