Attached are preliminary patches for full d6 protocol support, including opacity buffer. A windows client build is also attached. I will probably check this in soon, but posting it here for comments and to allow others to update their ports.
This introduces a new minor live view protocol revision (2.2) Arguably, this should be a "major" version, not backward compatible, but old clients should work fine for non-digic 6 cameras, and fail relatively gracefully for digic 6. The updated chdkptp code supports both 2.1 and 2.2.
The G7X port is fully updated. I made my best guess at the required changes for sx280. I haven't attempted to update the sx60 port since I think the svn source is quite a bit behind 62ndidiots.
Things that need attention in digic 6 ports
- The _proper functions for digic 6 should not be 2x the normal values. See g7x examples.
- palette type and size should be 0. This is the default in generic wrappers, so they do not need to be defined.
- vid_get_opacity_active_buffer must be implemented. See g7x
- vid_get_viewport_type must be implemented. Include the live_view.h for constants. Ports like the g7x only need to return LV_FB_YUV8B. The current sx280 code probably needs to return different values for play and rec.
- for playback image display vid_get_viewport_fb_d should be implemented and, dimension functions (*get_viewport_width etc) should return a non-zero value in playback mode
- for full support of different shooting aspect ratios etc, the various vid_*offset functions must be implemented. G7X has a fairly complete implementation, but specifics will vary by camera.
- I have not tested behavior with TV or HDMI out.
General chdkptp notes
- I added a checkbox to skip the d6 opacity buffer. Since all the protocol data is sent in every frame, this is available whether it makes sense for the camera or not.
- lvdump, lvdumpimg and screenshots should work. lvdumps should be compatible to the same extent real live view is.
- I made a zero image size (which can happen if the viewport sizes aren't correctly implemented) treated the same as no data returned (e.g. if viewport address is null)
- chdkptp live code now checks the live protocol version, which it did not before.
Other CHDK notes
- Pulling the live view headers into lib.c / wrappers.c is not really clean, but using the same constants makes sense.
- The opacity buffer description is sent regardless of whether the camera has one or whether opacity data was requested. It's only ~36 bytes, not significant compared to any of the frame buffers. The type is set to LV_FB_OPACITY8 regardless, because we don't have a "none" type. Possibly, it would make more sense not to send the description at all on cameras that don't support it (e.g. lv->bmo_desc_start = 0). The rational for sending the description for buffers that don't have data selected is that it allows clients to determine what kinds of buffers are present.
- The use of THUMB_FW to decide various things in live_view.c probably isn't great, we should probably have defines and/or functions for the specific characteristics. I added a function for the viewport type, since on SX280 it varies between modes.
- I did not define a wrappers.c default vid_get_opacity_active_buffer. d6 ports must implement it. Others should not.
- I defined the wrappers.c default vid_get_viewport_type for pre-d6 only, since all those cameras to date use the same format.