I use DirectShowLib .Net to capture images from WebCam. How get state of my WebCam in C#? I mean if it's alredy using by another app?
Build a capture graph, such as Camera
-> Null Renderer
and put it into paused state. If you succeeded, the camera is (was) idle becuase otherwise this third party app would lock it exclusively.
You could possibly use IAMResourceControl
too, but it's unlikely to be available for a camera device.
来源:https://stackoverflow.com/questions/8655951/get-webcam-status-using-c-sharp