Great found the most suitable crate for my test program:
https://github.com/zesterer/eucI.e. I can pre-render the frame to buffers and then loop those frames to "cast_fd" with a given FPS (25) so it should be fairly timing accurate.
Using rotating and shaded torus I have cyclic movement which the other side (opening /dev/video0) can then read and store a full cycle of the animation.
Client and server can be two threads in the same process, and as final step the client can compare that the read frames are close proximity enough to the pre-rendered frames.
That should create a full headless and "CI friendly" system test for v4l2-cast. Definitely still hold a bit before doing too heavy refactoring and make this happen!
I wonder can we already have Rust programs in kselftest's? My driver is in C but this could be potentially part of the kselftest (at some point).
#linux #kernel #video4linux