From: Rob S. <ro...@in...> - 2004-07-06 21:59:42
|
Robert Winder wrote: > Driver: ivtvr=CE=E0=E2=D2=CD=F3=BC=C4 > Card: Vanilla iTVC15 card q=CE=E2[=C0 Yeah, that junk's causing problems. > QUERYCAP_ST =3D "16s32s32sLL16x" > QUERYCAP_NO =3D _IOR('V', 0, QUERYCAP_ST) >=20 > Not sure what to make of this mumbo jumbo ;-) Rob can you explain wha= t > you are trying to do here with 16s32s32sLL16x ? Willing to help if yo= u > got some pointers. Heh. Ok, start by reading: http://www.python.org/doc/2.3.4/lib/module-struct.html We need to turn the results of the QUERYCAP_NO (really a hex number)=20 driver ioctl call into something python and understands. def querycap(self): val =3D struct.pack( QUERYCAP_ST, "", "", "", 0, 0 ) r =3D fcntl.ioctl(self.device, long(QUERYCAP_NO), val) return struct.unpack( QUERYCAP_ST, r ) That function gives us a list returned by the ioctl. Also note in the=20 struct pack line: "", "", "", 0, 0; a string, string, string, int, int.= =20 Well in C these tyles are more complec, and from reading the v4l=20 header file you can see the struct returned has members like 16 char=20 array, 2 - 32 char arrays, 2 - unsigned longs, and 16 bytes of padding.= =20 Ok, so this one probably doesn't ring a bell now because I just=20 remembered Thomas was the one who made this file, and I think that was=20 based on another project, so, perhaps the interface has changed. Maybe= =20 someone should review the v4l or ivtv header files and compare all the=20 struct packing/unpacking. I will take a peek later perhaps but atm I'm= =20 a bit busy. -Rob |