raymanfx / eye-rs

Cross platform camera capture in Rust
MIT License
140 stars 10 forks source link

Add function to stop a device stream #5

Open pintariching opened 2 years ago

pintariching commented 2 years ago

I'm using a camera that uses the tiscamera library. However that is written in C++. I'm currently working a project in rust that would use that camera but I'm getting similar problems that are probably specific to this camera. I can get a solid stream working, but only "once per plug in" so to say. If I start a stream, end the program with CTRL+C and then start the program once again, it hangs indefinitely on the line let frame = stream.next().unwrap() without any errors and also without frames.

This happens if the stream is not "properly" ended I think. When I used the above library and opened and closed the stream I could re-run the program without needing to plug the camera out and back in.

Would it be reasonable to implement such a function to stop a stream?