Tuesday, November 3, 2009

iPhone Camera Access Module from GamesAlfresco


Many people may know about the pose at GamesAlfresco (Original post is here), which says they made iPhone camera access possible on the firmware 3.x .Last weekend, I received the source code from Ori Inbar and did some tests with the camera access module.

It works well by itself. I could retrieve the raw data coming from the camera. The module uses a trick similar to what I tried on iPhone OS 2.x, creating CoreSurface buffer of preview from the camera.

However, the problem comes when I overlay something.

When I overlay some contents (like an image view or OpenGL drawings) on the preview view of the camera, the overlaid contents appear in the capture video frame. That is, the captured frame is like a screenshot, not a raw video.

I experienced a similar situation with the 'takePhoto' method, which gives a screenshot of the iPhone's screen and the module received from Ori also have the same issue.

Here are two captured images from incoming raw data of the camera module.They are not screenshots. As we can see, when I overlay an OpenGL view or a UIImageView on top of the 'previewView' of PLCameraController, the overlaid contents are also captured.



So, we still have problems with iPhone 3GS' camera.