oli-obk / camera_capture

Crate for capturing images from a webcam
51 stars 17 forks source link

Is this crate supposed to work with MacOS? #5

Open LukasKalbertodt opened 7 years ago

LukasKalbertodt commented 7 years ago

The source only distinguishes between unix and windows and for unix, rscam is used. But this is just a wrapper around v4l2 which seems to not exist for MacOS?

oli-obk commented 7 years ago

I don't have a mac, so I was not able to develop for MacOS. I'll happily take PRs for that though ;)

LukasKalbertodt commented 7 years ago

I was asking for a friend, I don't own a Mac either, so I won't be able to contribute anything :(

Said friend and I tried to quickly find out how webcam stuff works on MacOS. We didn't find out much in this limited time, but I want to share a few things which might be helpful for someone interested in implementing this:

Accessing webcams is done via AV Foundation, apparently a big OS API for all kinds of audio/video things. Apparently this API has to be called from Objective-C. Now I don't know if the Objective-C interface is compatible with the C interface. If that were the case, we could call those API methods from Rust directly. If not, we would have to write some Objective-C and expose a C interface ourselves. That would probably kinda suck. Now from a quick google search it looks like it is possible somehow. But again: I really don't know anything about MacOS development.

Maybe we could get "This week in Rust" to mention this issue as "contribution welcome"?