mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
Made it work with the sub-spec burst capture interface
(no bit vector)
This commit is contained in:
parent
44c1f698a5
commit
be0cba4d5b
1 changed files with 12 additions and 3 deletions
|
|
@ -1,16 +1,23 @@
|
||||||
|
import sys
|
||||||
import sv, SV
|
import sv, SV
|
||||||
import gl, GL, DEVICE
|
import gl, GL, DEVICE
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
format = SV.RGB8_FRAMES
|
format = SV.RGB8_FRAMES
|
||||||
requestedwidth = SV.PAL_XMAX
|
requestedwidth = SV.PAL_XMAX
|
||||||
queuesize = 2
|
queuesize = 30
|
||||||
|
if sys.argv[1:]:
|
||||||
|
queuesize = eval(sys.argv[1])
|
||||||
|
|
||||||
v = sv.OpenVideo()
|
v = sv.OpenVideo()
|
||||||
svci = (format, requestedwidth, 0, queuesize, 0)
|
svci = (format, requestedwidth, 0, queuesize, 0)
|
||||||
|
|
||||||
svci, buffer, bitvec = v.CaptureBurst(svci)
|
go = raw_input('Press return to capture ' + `queuesize` + ' frames: ')
|
||||||
[bitvec]
|
result = v.CaptureBurst(svci)
|
||||||
|
## svci, buffer, bitvec = result # XXX Bit vector not yet implemented
|
||||||
|
svci, buffer = result
|
||||||
|
|
||||||
|
print 'Captured', svci[3], 'frames, i.e.', len(buffer)/1024, 'K bytes'
|
||||||
|
|
||||||
w, h = svci[1:3]
|
w, h = svci[1:3]
|
||||||
framesize = w * h
|
framesize = w * h
|
||||||
|
|
@ -23,6 +30,8 @@ def main():
|
||||||
gl.qdevice(DEVICE.LEFTMOUSE)
|
gl.qdevice(DEVICE.LEFTMOUSE)
|
||||||
gl.qdevice(DEVICE.ESCKEY)
|
gl.qdevice(DEVICE.ESCKEY)
|
||||||
|
|
||||||
|
print 'Click left mouse for next frame'
|
||||||
|
|
||||||
for i in range(svci[3]):
|
for i in range(svci[3]):
|
||||||
inverted_frame = sv.RGB8toRGB32(1, \
|
inverted_frame = sv.RGB8toRGB32(1, \
|
||||||
buffer[i*framesize:(i+1)*framesize], w, h)
|
buffer[i*framesize:(i+1)*framesize], w, h)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue