Let me understand: you do patch the camera firmware or the external ptpcam dll ? Is the ptp livepreview a binary compiled thing or some kind of LUA hack to provide realtime buffers ?
Liveview support requires code in CHDK on the camera. It also requires a client that understands the protocol.
In the livepreview do we get the viewfinder images or also the menus and everything on the LCD screen ?
The UI (aka bitmap) and viewfinder (aka viewport) are separate framebuffers on the camera. Both are available in the current work-in-progress PTP protocol, although support is not complete for every camera. See
http://chdk.wikia.com/wiki/Frame_buffers for information about the various camera frame buffers.
You can see some screenshots in the chdkptp thread.
Also, how do I check out latest version and am I able to compile with mingw ?
For the client, see
http://www.assembla.com/wiki/show/chdkptp - The readme explains the prerequisites. mingw is the preferred toolchain for windows.
For the CHDK side, you need to use this branch
http://trac.assembla.com/chdk/browser/branches/reyalp-ptp-live You can use chdkshell to build on windows. See
http://chdk.wikia.com/wiki/For_Developers for more information about how to set up a CHDK development environment on various platforms.
Finally, I would like to create a python wrapper and make this work both on windows and linux via libusb. I can use some functions to convert from yuv to rgb et.al so if I am able to access the raw buffers it would be nice.
That should be possible. If you want to use libusb directly, you will need to make your own implementation of the CHDK PTP protocol. OTOH, chdkptp is cross platform and already has a Lua API (in fact, it's mostly written in Lua, the C code only provides some low level APIs), so you might just want to use lua. It includes code to convert the framebuffers to RGB.