Attached is my (sketchy) try to allow using a movie_status variable that behaves differently. All 3 candidates I found so far on the sx280 behave like: 0 when not recording, nonzero (usually 1) while recording.
Thanks for doing this.
I've attached a patched with some changes (improvements? Maybe
but feel free to treat these as suggestions)
* Made CAM_VIDEO_CONTROL exclusive with CAM_SIMPLE_MOVIE_STATUS, with #error in camera.h
Control doesn't currently make sense if the variable is only on-off. This means VIDEO_CONTROL related ifdefs don't have to check both, and ensures menu items don't show up on cameras with SIMPLE. We might theoretically find firmware functions that allow control on these cams, but we can cross that bridge if we get to it.
* Made movie_status only declared in core/shooting.c, converted all other references to function calls. This involves a search/replace in a bunch of platform files.
* Renamed the "simple" variable simple_movie_status, also restricted to shooting.c. This makes it clearer that they refer to different firmware variables (helpful for people looking at stubs, eventual sigfinder addition), and will trigger compiler errors if the wrong one is used with wrong ifdef.
I haven't tested this exhaustively. I did built d10 and verified that lua get_movie_status() and get_video_recording() return the expected values. I also built it with a dummy simple_movie_status and verified it always returned the "not recording" values. I built a540 and verified that fast video control still works.
I did not build all the cameras affected by the search/replace platform.
Other notes:
A number of the references to video_status are essentially check "is the camera in a video mode or recording" e.g. the touch camera kbd.c files and some of the lib.c files. A dedicated function for this would be good.
ixus65 has a dummy movie_status variable. Could possibly be converted to simple.
I've never been fond of the whole VIDEO_CONTROL thing, it always seemed a bit too hacky to be useful to me.
The patch assumes this behaviour for the alternative movie_status. I don't know how future-proof this is.
It seems pretty likely there will be some variable that behaves like this.
Cameras without a dedicate video mode could just use the fact that video recording is indicated by <still mode> | 0x400. This could be implemented with a different value of SIMPLE_MOVIE_STATUS (e.g. 1 = variable, 2 = propcase)
There's more stuff that relies on evaluation of Canon variables directly in CHDK core (detection of Canon menus and various states for example), fortunately those are still working.
Yes,
canon_menu_active!=(int)&canon_menu_active-4
was one I had in mind
edit:
Oops, first version of patch had d10 dummy simple_movie_status. Updated