Accord.Video.AsyncVideoSource.Start C# (CSharp) Method

Start() public method

Start video source.

Starts the nested video source and returns execution to caller. This object creates an extra thread which is used to fire NewFrame events, so the image processing could be done on another thread without blocking video acquisition thread.

public Start ( ) : void
return void
        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();
            }
        }