Accord.Controls.VideoSourcePlayer.Stop C# (CSharp) Method

Stop() public method

Stop video source.

The method stops video source by calling its Accord.Video.IVideoSource.Stop method, which abourts internal video source's thread. Use SignalToStop and WaitForStop for more polite video source stopping, which gives a chance for video source to perform proper shut down and clean up.

public Stop ( ) : void
return void
        public void Stop()
        {
            CheckForCrossThreadAccess();

            requestedToStop = true;

            if (videoSource != null)
            {
                videoSource.Stop();

                if (currentFrame != null)
                {
                    currentFrame.Dispose();
                    currentFrame = null;
                }

                Invalidate();
            }
        }