I had been trying to use this library such that there are no blocked threads when waiting on a frame and after a couple days, I tried making ActiveCamera implement Send, and it seems to work. To be clear there are ways to make it async, but no way I could find that does not involve a thread getting CPU time with no work to do.
- Is there a reason only
Request and Stream were marked Send?
- Am I missing a reason I shouldn't be doing that? I really don't know the project that well, and I can't rigorously prove it can be Send.
Why ActiveCamera can be Send
Again, don't really know what I'm doing here, but I thought I'd lay it out.
- It works. I'm using it now, while also passing between threads.
- Clanker said so.
Impact
It makes an async frame channel much easier.
Edit: heres the fork: [https://github.com/paul-fornage/libcamera-rs]
Not submitting a PR because I really can't confirm this doesn't break an edge case, and with all the FFI I don't trust myself to guarantee anything. But. On my machine, this works fine. If you think it looks good, I can submit it. (or just copy paste it, its + 1 line and + 1 file)
I had been trying to use this library such that there are no blocked threads when waiting on a frame and after a couple days, I tried making
ActiveCameraimplementSend, and it seems to work. To be clear there are ways to make it async, but no way I could find that does not involve a thread getting CPU time with no work to do.RequestandStreamwere markedSend?Why
ActiveCameracan beSendAgain, don't really know what I'm doing here, but I thought I'd lay it out.
Impact
It makes an async frame channel much easier.
Edit: heres the fork: [https://github.com/paul-fornage/libcamera-rs]
Not submitting a PR because I really can't confirm this doesn't break an edge case, and with all the FFI I don't trust myself to guarantee anything. But. On my machine, this works fine. If you think it looks good, I can submit it. (or just copy paste it, its + 1 line and + 1 file)