techyian / MMALSharp

C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
MIT License
195 stars 33 forks source link

Framerate and MMAL_RATIONAL_T #158

Closed MV10 closed 3 years ago

MV10 commented 3 years ago

Setting FPS with MMAL_RATIONAL_T seemed weird when I was getting started with the library. I'm not a photography / camera guy, is the need for fractions commonplace or is that just native MMAL peeking through?

Since I'm getting involved with v0.7 and the 0.6 VideoFramerate code has to change to Framerate anyway, maybe 0.7 uses a regular int for Framerate and internally converts to MMAL_RATIONAL_T? Or if fractions really are commonly used, perhaps a Framerate.FPS(int) static helper class?

techyian commented 3 years ago

Yeah that's native MMAL you're seeing there, I've just used the struct type that's marshalled through to represent framerate but yes I agree that this can be improved. It would need to be a double as the new camera module can support a framerate as low as 0.005.

I'll look at adding this in for v0.7.