/// <summary>
        /// Stop video source.
        /// </summary>
        ///
        /// <remarks><para>The method stops video source by calling its <see cref="AForge.Video.IVideoSource.StopVideo"/>
        /// method, which abourts internal video source's thread. Use <see cref="SignalToStop"/> and
        /// <see cref="WaitForStop"/> for more polite video source stopping, which gives a chance for
        /// video source to perform proper shut down and clean up.
        /// </para></remarks>
        ///
        public void Stop( )
        {
            CheckForCrossThreadAccess( );

            requestedToStop = true;

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

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

                Invalidate( );
            }
        }
Example #2
0
 /// <summary>
 /// Stop video source.
 /// </summary>
 ///
 /// <remarks><para>Stops nested video source by calling its <see cref="IVideoSource.StopVideo"/> method.
 /// See documentation of the particular video source for additional details.</para></remarks>
 ///
 public void StopVideo( )
 {
     nestedVideoSource.StopVideo( );
     Free( );
 }