public void Stop()
{
try
{
// Check if the capture device is even running
if (IsRunning)
{
// Yes, stop via the event
StopSignal.Set();
// Abort the thread
Worker.Abort();
if (Worker != null)
{
// Join
Worker.Join();
// Release
Release();
}
}
}
catch (Exception ex)
{
// Trace
Trace.TraceError(ex.Message);
// Release
Release();
}
}