Closed GregMefford closed 6 years ago
My 2 cents:
This looks useful!
I'm a little worried about maintaining it since every change to Camera
is going to need to be replicated in FakeCamera
. Do you have any ideas on how to force/encourage us to keep them synchronized?
Also, I was going to say something about FakeCamera
and images being installed even when they're not used. The files aren't all that big, though, so I don't think that it's worth coming up with some complicated way to prune them out for "real" builds. If you could run the images through an optimizer, that would be nice.
BTW, I don't know how others feel about this, but next time you forget to add a couple files, feel free to rebase and force push to hide the "oops" commit.
Awesome! Thanks @GregMefford.
Yep, I agree on all points, @fhunleth. I just needed this for my training next week, but I wanted to get it into the real Picam
instead of forking my own version for training. There is definitely some room for improvement and I have some ideas about how to make it work more seamlessly, but out of time for refactoring at this stage.
This adds a fake version of the
Picam.Camera
GenServer that can be used for testing on non-Raspberry Pi hardware, where the real camera isn't available.The C code is already set up so this works by skipping compilation and generating the following warning:
This warning is fine as it is IMO, but we could potentially add a note like
this warning can be safely ignored if you're intentionally running with MIX_TARGET=host
, or maybe we can somehow detect that this is the case and suppress the warning).