AForge.Video.DirectShow.FileVideoSource.Start C# (CSharp) Method

Start() public method

Start video source.
Starts video source and return execution to caller. Video source object creates background thread and notifies about new frames with the help of NewFrame event.
public Start ( ) : void
return void
        public void Start( )
        {
            if ( !IsRunning )
            {
                // check source
                if ( ( fileName == null ) || ( fileName == string.Empty ) )
                    throw new ArgumentException( "Video source is not specified" );

                framesReceived = 0;
                bytesReceived = 0;

                // create events
                stopEvent = new ManualResetEvent( false );

                // create and start new thread
                thread = new Thread( new ThreadStart( WorkerThread ) );
                thread.Name = fileName; // mainly for debugging
                thread.Start( );
            }
        }