简体   繁体   中英

lock device (webcam) from other applications

I have an application that captures an image from a webcam.

I noticed that if I have Microsoft LifeCam installed in my computer, when starting the device from c#, Windows will start LifeCam automatically.

Obviously the easy way out is to uninstall LifeCam but is there a way to lock the device to my application only? The reason being is because I set image size, brightness, exposure, etc and when LifeCam starts, all of my settings are set to default.

Not that I know of. LifeCam is most likely using DirectShow to access the camera and while some directshow filters allow concurrent access, there isn't anything in the DirectShow API to let you prevent another application from trying to instantiate the driver. Usually what happens is that the second application gets a bunch of errors saying "Device in use", but sometimes not.

I think your best bet here is to just uninstall the lifecam software.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM