예제 #1
0
        public void StartCapture()
        {
            //Setup specific Device
            try
            {
                //lets be cautious with VIW
                //Check to see if ID is valid first.
                int num = VIWrapper.ListDevices();
                if (deviceId < num)
                {
                    VIWrapper.SetRequestedMediaSubType(mediaSubtype);
                    VIWrapper.SetFormat(deviceId, formatType);
                    VIWrapper.SetupDevice1(deviceId, physicalType);
                    VIWrapper.SetIdealFramerate(deviceId, idealFrameRate);

                    //Start the capture thread
                    captureThread              = new Thread(new ParameterizedThreadStart(_capThread));
                    captureThread.Name         = "CaptureThread";
                    captureThread.IsBackground = true;
                    isCaptureRunning           = true;
                    captureThread.Start(deviceId);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception occured while trying to start video capture. \n" + e);
            }
            //Turn on capture thread
        }
 public void RefreshList()
 {
     DeviceList.Clear();
     numDevices = VIWrapper.ListDevices();
     for (int i = 0; i < numDevices; i++)
     {
         DeviceList.Add(VIWrapper.GetDeviceName(i));
     }
 }
예제 #3
0
 public void RefreshList()
 {
     DeviceList.Clear();
     numDevices = VIWrapper.ListDevices();
     for (int i = 0; i < numDevices; i++)
     {
         DeviceList.Add(VIWrapper.GetDeviceName(i));
     }
     OnPropertyChanged("DeviceID");
     OnPropertyChanged("DeviceList");
 }