There was a three day weekend here, so I got some real coding done on my GSoC project.
You can pull the code I’m working on from my repository at http://git.n0r.org/?p=pygame-nrp;a=summary
It is currently barely alpha quality, but it supports v4l2 cameras that use MMAP and YUYV or RGB24 pixelformats. That means it’ll work on the OLPC XO, though you’ll need to install gcc, SDL-devel, and probably some other stuff to compile it.
You can open a camera with:
cam = camera.Camera(device, (width, height))
Device in most cases is going to be
(width, height) will probably be
You then need to start the camera with
cam.get_image() will return an RGB Surface.
cam.close() closes the camera if necessary.