Beispiel #1
0
        /// <summary>
        /// Stops the capturing process. Calls to the snapshot listener will
        /// stop after invoking this method. It's safe to stop the video capture
        /// more than once (if already stopped this method does nothing)
        /// </summary>
        public void StopCapturing()
        {
            if (!capturing)
            {
                return;
            }

            lock (this)
            {
                capturing = false;
            }

            if (captureThread != null)
            {
                captureThread.Stop();
                captureThread = null;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Begins the capturing process. Calls to the snapshot listener will begin
        /// from a different thread after invoking this method. It's safe to start
        /// the video capture more than once (if already started this method does nothing)
        /// </summary>
        public void StartCapturing()
        {
            if (IsCapturing)
            {
                return;
            }

            lock (this)
            {
                capturing = true;
            }

            captureThread = new CaptureThread(this);
            captureThread.Start();
        }