public void StartCamera(LiveCamStatus cameraId)
        {
            switch (cameraId)
            {
            case LiveCamStatus.webCamLocal2:
                StopCamera();
                _videoSource           = new MJPEGStream("http://192.168.1.192:8089/video");
                _videoSource.NewFrame += video_NewFrame;
                _videoSource.Start();
                IsWebCamLocal1Play = false;
                IsWebCamLocal2Play = true;
                break;

            case LiveCamStatus.webCamLocal1:
                if (CurrentDevice != null)
                {
                    StopCamera();
                    _videoSource           = new AForge.Video.DirectShow.VideoCaptureDevice(CurrentDevice.MonikerString);
                    _videoSource.NewFrame += video_NewFrame;
                    _videoSource.Start();
                    IsWebCamLocal1Play = true;
                    IsWebCamLocal2Play = false;
                }
                else
                {
                    MessageBox.Show("Current device can't be null");
                }
                break;


            default:
                break;
            }
        }
Exemplo n.º 2
0
        public void StartCamera(LiveCamStatus cameraId, System.Windows.Controls.Image image, String ipWebcam = null)
        {
            switch (cameraId)
            {
            case LiveCamStatus.webCamLocal2:
                _videoSource           = new MJPEGStream(ipWebcam);
                _videoSource.NewFrame += new NewFrameEventHandler((sender, args) => {
                    video_NewFrame(sender, args, image);
                });
                _videoSource.Start();
                break;

            case LiveCamStatus.webCamLocal1:
                if (CurrentDevice != null)
                {
                    StopCamera(image);
                    Thread.Sleep(1000);
                    _videoSource           = new AForge.Video.DirectShow.VideoCaptureDevice(CurrentDevice.MonikerString);
                    _videoSource.NewFrame += new NewFrameEventHandler((sender, args) => {
                        video_NewFrame(sender, args, image);
                    });
                    _videoSource.Start();
                }
                else
                {
                    MessageBox.Show("Current device can't be null");
                }
                break;


            default:
                break;
            }
        }
Exemplo n.º 3
0
 private void meLocalCam_Clicked(object sender, MouseButtonEventArgs e, LiveCamStatus status)
 {
     liveGrid.Children.Clear();
     imgLive         = new Image();
     imgLive.Stretch = Stretch.Fill;
     liveGrid.Children.Add(imgLive);
     locaCam.StartCamera(status, imgLive);
 }
Exemplo n.º 4
0
 private void meWebCam_Clicked(object sender, MouseButtonEventArgs e, LiveCamStatus status, String ipWebcam, int index)
 {
     liveGrid.Children.Clear();
     imgLive         = new Image();
     imgLive.Stretch = Stretch.Fill;
     liveGrid.Children.Add(imgLive);
     webCam[index].StartCamera(status, imgLive, ipWebcam);
 }
        // MIX LIVE MANAGE

        private void ManagerLiveMix(LiveCamStatus status)
        {
            switch (status)
            {
            case LiveCamStatus.webCamLocal1:

                ColorButtonsForWebCamLocal1();
                StopIfCamLivePlay();

                if (webCam.IsWebCamLocal1Play || webCam.IsWebCamLocal2Play)
                {
                    ColorButtonsForVideoLive();
                    imageLive.Visibility = Visibility.Visible;
                    turnOnButton(buttonMixLive1);
                    isWebCamLive        = true;
                    webCam.IsWebCamLive = true;
                }

                break;

            case LiveCamStatus.video1:
                if (video1List.CheckIfPlaylistNotNull())
                {
                    ColorButtonsForVideo1();

                    liveME.Tag = 1;
                    StopIfWebCamLivePlay();
                    StartLive();
                    video1List.NextIndexLive = video1List.NextIndex - 1;
                    PlayVideoList(video1List, liveME, true);
                }
                break;

            case LiveCamStatus.video2:

                if (video2List.CheckIfPlaylistNotNull())
                {
                    ColorButtonsForVideo2();

                    liveME.Tag = 2;
                    StopIfWebCamLivePlay();
                    StartLive();
                    video2List.NextIndexLive = video2List.NextIndex - 1;
                    PlayVideoList(video2List, liveME, true);
                }
                break;

            case LiveCamStatus.playlist:
                if (video3List.CheckIfPlaylistNotNull())
                {
                    ColorButtonsForPlaylist();

                    liveME.Tag = 3;
                    StopIfWebCamLivePlay();
                    StartLive();
                    PlayVideoList(video3List, liveME, true);
                }
                break;

            default:
                break;
            }
        }