loyd / rscam

Rust wrapper for v4l2
Other
116 stars 22 forks source link

Fails to compile on MacOS #13

Closed teovoinea closed 6 years ago

teovoinea commented 6 years ago

I'm using this crate as a dependant from oli-obk/camera_capture

I'm getting the following error:

error[E0425]: cannot find value `VIDIOC_STREAMON` in module `v4l2`
   --> /Users/teo/.cargo/registry/src/github.com-1ecc6299db9ec823/rscam-0.5.4/src/lib.rs:649:42
    |
649 |         try!(v4l2::xioctl(self.fd, v4l2::VIDIOC_STREAMON, &mut typ));
    |                                          ^^^^^^^^^^^^^^^ not found in `v4l2`

error[E0425]: cannot find value `VIDIOC_STREAMOFF` in module `v4l2`
   --> /Users/teo/.cargo/registry/src/github.com-1ecc6299db9ec823/rscam-0.5.4/src/lib.rs:656:42
    |
656 |         try!(v4l2::xioctl(self.fd, v4l2::VIDIOC_STREAMOFF, &mut typ));
    |                                          ^^^^^^^^^^^^^^^^ not found in `v4l2`

Using the latest rscam and camera_capture

sebasgarcep commented 6 years ago

Looking at the source, these only seem to be defined for linux and freebsd. So as far as I know this library won't work with MacOS. Look at this: https://users.rust-lang.org/t/are-there-any-video-capture-libraries-out-there/11241, and let me know if you manage to get anything running 😉 .

sebasgarcep commented 6 years ago

I've succesfully used libuvc-rs to capture a webcam stream @teovoinea. You may want to check it out.

teovoinea commented 6 years ago

Thanks @sebasgarcep! In the end, I've decided to use rust-objc to call an objective c library I wrote to access the webcam using the AVFoundation APIs. Hopefully it works out 😁

joelgallant commented 6 years ago

@teovoinea could this issue be closed? With #17, hopefully this makes it more clear in the future

teovoinea commented 6 years ago

@joelgallant #17 looks great, I'll close this out