l1npengtul / nokhwa

Cross Platform Rust Library for Powerful Webcam/Camera Capture
Apache License 2.0
482 stars 111 forks source link

AVFoundation backend is not passing the frame format #160

Open vyeevani opened 6 months ago

vyeevani commented 6 months ago

The pixelbuffer that's returned from the avfoundation callback is not guaranteed to be the same format as the one configured. This means that we have to query the cvpixelbuffer to get the pixel format that's being used by it for the decoder. The channel that's being used to pipe things from the callback to the poll API already has the pixel format but right now it's being hardcoded to grey. This should be dynamic.

marcpabst commented 6 months ago

Can you point me to the AVFoundation documentation? I think if a different pixel format is returned than requested, this should return an error to be handled by the user.