public void Start()
{
if (!IsRunning)
{
framesProcessed = 0;
// create all synchronization events
isNewFrameAvailable = new AutoResetEvent(false);
isProcessingThreadAvailable = new AutoResetEvent(true);
// create image processing thread
imageProcessingThread = new Thread(new ThreadStart(imageProcessingThread_Worker));
imageProcessingThread.Start();
// start the nested video source
nestedVideoSource.NewFrame += new NewFrameEventHandler(nestedVideoSource_NewFrame);
nestedVideoSource.Start();
}
}