Esempio n. 1
0
        private void Play()
        {
            anpr       = new ANPR(camera.timeout + 50, camera.countForPass, camera.size);
            anpr.camID = camera.camID;

            string path = camera.camURL;

            //string path = @".\netDev_04.ts";
            player = new MediaPlayer(".\\plugins");

            player.SetRenderWindow((int)this.panel1.Handle);
            player.PlayStream(path, 1920, 1080);
            //player.PlayFile(path);

#if TEST_PAINTEVENT
            panel1.Paint += panel1_Paint; // change to timer
#else
            //
            timerEvent = new AutoResetEvent(true);
            timer      = new System.Threading.Timer(MediaTimerCallBack, null, 100, camera.timeout);
            anpr.ANPRRunThread();
            anpr.ANPRDetected += anpr_ANPRDetected;
#endif

            connectToolStripMenuItem.Enabled    = false;
            disconnectToolStripMenuItem.Enabled = true;

            notifyColor = Color.Red;
        }
Esempio n. 2
0
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            anpr       = new ANPR();
            anpr.camID = camera.camID;

            //string path = camera.camURL;
            string path = @"C:\VideoTest\LPR\2016-02-17_14-45-00.avi";

            player = new MediaPlayer(".\\plugins");

            player.SetRenderWindow((int)this.panel1.Handle);
            //player.PlayStream(path, 1920, 1080);
            player.PlayFile(path);

#if TEST_PAINTEVENT
            panel1.Paint += panel1_Paint; // change to timer
#else
            //
            timerEvent = new AutoResetEvent(true);
            timer      = new System.Threading.Timer(MediaTimerCallBack, null, 100, 33);
            anpr.ANPRRunThread();
            anpr.ANPRDetected += anpr_ANPRDetected;
#endif

            connectToolStripMenuItem.Enabled    = false;
            disconnectToolStripMenuItem.Enabled = true;
        }
Esempio n. 3
0
        private void Stop()
        {
            /*if (player != null)
             * {
             *  player.Stop();
             * }*/
            Thread stopLibVLCThread = new Thread(new ThreadStart(StopLibVLCThread));

            stopLibVLCThread.Start();

            if (playerMjpeg != null)
            {
                playerMjpeg.Stop();
            }

            if (timer != null)
            {
                timer.Change(Timeout.Infinite, Timeout.Infinite); // stop timer
                timer.Dispose();
                timer = null;
            }

            if (anpr != null)
            {
                anpr.ANPRStopThread();
                anpr.ANPRDetected -= anpr_ANPRDetected;
                anpr = null;
            }

            notifyColor = Color.LightGray;
            notifyCount = 0;
            DrawBorder();

            lastPlayTime      = 0;
            mediaMonitorCount = 0;

            overflowCount = 0;

            //_plateListIdx = 0;
            //_plateList.Clear();
        }
Esempio n. 4
0
        private void Stop()
        {
            if (player != null)
            {
                player.Stop();
            }

            if (playerMjpeg != null)
            {
                playerMjpeg.Stop();
            }

            timer.Change(Timeout.Infinite, Timeout.Infinite); // stop timer
            timer.Dispose();
            timer = null;

            anpr.ANPRStopThread();
            anpr.ANPRDetected -= anpr_ANPRDetected;
            anpr = null;

            //_plateListIdx = 0;
            //_plateList.Clear();
        }
Esempio n. 5
0
        private void Stop()
        {
            /*if (player != null)
            {
                player.Stop();
            }*/
            Thread stopLibVLCThread = new Thread(new ThreadStart(StopLibVLCThread));
            stopLibVLCThread.Start();

            if (playerMjpeg != null)
            {
                playerMjpeg.Stop();
            }

            if (timer != null)
            {
                timer.Change(Timeout.Infinite, Timeout.Infinite); // stop timer
                timer.Dispose();
                timer = null;
            }

            if (anpr != null)
            {
                anpr.ANPRStopThread();
                anpr.ANPRDetected -= anpr_ANPRDetected;
                anpr = null;
            }

            notifyColor = Color.LightGray;
            notifyCount = 0;
            DrawBorder();

            lastPlayTime = 0;
            mediaMonitorCount = 0;

            overflowCount = 0;

            //_plateListIdx = 0;
            //_plateList.Clear();
        }
Esempio n. 6
0
        private void Play()
        {
            anpr = new ANPR(camera.timeout, camera.countForPass, camera.size);
            anpr.camID = camera.camID;

            string path = camera.camURL;
            //string path = @".\netDev_04.ts";
            player = new MediaPlayer(".\\plugins");

            player.SetRenderWindow((int)this.panel1.Handle);
            player.PlayStream(path, 1920, 1080);
            //player.PlayFile(path);

#if TEST_PAINTEVENT
            panel1.Paint += panel1_Paint; // change to timer
#else
            //
            timerEvent = new AutoResetEvent(true);
            timer = new System.Threading.Timer(MediaTimerCallBack, null, 100, camera.timeout);
            anpr.ANPRRunThread();
            anpr.ANPRDetected += anpr_ANPRDetected;
#endif

            connectToolStripMenuItem.Enabled = false;
            disconnectToolStripMenuItem.Enabled = true;

            notifyColor = Color.Red;
        }
Esempio n. 7
0
        private void Stop()
        {
            if (player != null)
            {
                player.Stop();
            }

            if (playerMjpeg != null)
            {
                playerMjpeg.Stop();
            }

            timer.Change(Timeout.Infinite, Timeout.Infinite); // stop timer
            timer.Dispose();
            timer = null;

            anpr.ANPRStopThread();
            anpr.ANPRDetected -= anpr_ANPRDetected;
            anpr = null;

            //_plateListIdx = 0;
            //_plateList.Clear();
        }
Esempio n. 8
-39
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            anpr = new ANPR();
            anpr.camID = camera.camID;

            //string path = camera.camURL;
            string path = @"C:\VideoTest\LPR\2016-02-17_14-45-00.avi";
            player = new MediaPlayer(".\\plugins");

            player.SetRenderWindow((int)this.panel1.Handle);
            //player.PlayStream(path, 1920, 1080);
            player.PlayFile(path);

            #if TEST_PAINTEVENT
            panel1.Paint += panel1_Paint; // change to timer
            #else
            //
            timerEvent = new AutoResetEvent(true);
            timer = new System.Threading.Timer(MediaTimerCallBack, null, 100, 33);
            anpr.ANPRRunThread();
            anpr.ANPRDetected += anpr_ANPRDetected;
            #endif

            connectToolStripMenuItem.Enabled = false;
            disconnectToolStripMenuItem.Enabled = true;
        }