CapSoftware / scap

High-performance, cross-platform screen capture library in Rust.
https://crates.io/crates/scap
Other
231 stars 44 forks source link

(Windows) Run capture engine on a different / non-blocking thread. #5

Closed clearlysid closed 1 year ago

clearlysid commented 1 year ago

Currently, the capturing "hijacks" the main thread and we lose external control on it. Ideally, I would like the capturing to be async/non-blocking in nature. I don't yet know the best approach to do this. ScreenCaptureKit on macOS is non-blocking and works closer to how I want it to work but I don't know how it achieves that under the hood.

Open questions:

  1. Should the capturer simply be run on an independent thread?
  2. Should this be implemented upstream in windows-capture or should it be handled in cypher itself?
NiiightmareXD commented 1 year ago

Added To windows-capture v1.0.22

Instead of WindowsCaptureHandler::start use WindowsCaptureHandler::start_free_threaded

clearlysid commented 1 year ago

Thanks a ton! Sending you a message on Discord and handling this in #15 🥳