I have an application that captures video and images from webcams. Normally it works well and reliably using the DirectShow.net wrapper.Stopping the graph often leads to deadlocks however. It uses a number of filters including the sampleGrabber filter and vendor supplied filters (which we cannot edit or replace). Normal mediaControl methods to stop the graph does not work. Because we cannot edit the vendor filters, we cannot remove the deadlock and free up the cameras. Terminating the application fixes the problem and frees up the cameras. Is there any way to terminate the DirectShow thread(s) without terminating the parent application?
My application is in c# but if you have a c++ answer I will accept it and port it.
If it is frozen, the only way to break the deadlock (esp. to release lock on exclusive resource such as camera) is to kill the entire process.