Libcamera "simple" example usage has three files, 600 lines total. Good news is that it works, bad news is that it stops working almost as soon as I modify it... and not in a way that is easy to debug (segfault, debug trap, backtrace pointing to source line with "}"). I integrated it with SDL, and that was easy, got buffers mapped and translated to format that can be displayed. But when I try to close front camera and open back one, or to change resolution, bad things (tm) happen. Fact that empty build takes 15 seconds also does not help.
My code is at
https://gitlab.com/tui/libcamera/-/commit/456a19f64e1b0959cdc9b1b9fa666963772a383c. Press "Snap" button to demonstrate the problem.
If you can help debugging it, or can get it to work, or know better example to start from, please let me know. Would not mind boosts. You may get libcamera based application to take photos / record videos on phones in future if we can get this to work.