@reyalp
it's probably time to split this discussion to the "1.5 plans" thread
I think it's big enough for it's own thread
I agree with Phil quite a bit of the problem because that capturing the behavior of all the different cameras is actually complicated. For example, a lot of the viewport functions need to be functions, because they change at runtime on some cameras.
That said, it's really hard to tell at a glance what values a camera is using, or how those values ended up being used. We currently use values from:
camera.h
platform_camera.h
camera_info structures
generic/wrappers
camera lib.c and/or sub/lib.c
chaining through weak functions makes it even more confusing. E.g. some cameras implicitly use
vid_get_viewport_width_proper() { return vid_get_viewport_width()*2; }
while others might implement _width_proper() make _viewport_width() use half that.
I have always found the camera_info structures hard to follow, because it's very hard to tell which field a particular define goes in. I understand why it is that way (assigning in code would add significant size), but every time I look at those initializations I think there must be a better way.
Using both the camera_info values and the camera.h defines also makes it harder to keep track of, since you have to grep for both, and (because of the initialization thing) you don't see which defines go in which field.
Of course, any significant re-work is going to be difficult since it will require blind changes on a bunch of cams.
Documentation could certainly help.