Beispiel #1
0
 public LocalDevice()
 {
     try
     {
         _videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
     }
     catch (Exception ex)
     {
         MainForm.LogExceptionToFile(ex,"LocalDevice");
     }
 }
Beispiel #2
0
        public VideoSource()
        {
            InitializeComponent();
            RenderResources();

            bool empty = true;
            // show device list
            try
            {
                // enumerate video devices
                _videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (_videoDevices.Count > 0)
                {
                    foreach (iSpyPRO.DirectShow.FilterInfo device in _videoDevices)
                    {
                        devicesCombo.Items.Add(device.Name);
                    }
                    empty = false;
                }
            }
            catch (Exception ex)
            {
                Logger.LogExceptionToFile(ex);
            }
            if (empty)
            {
                ListEmptyCaptureDevices();
            }
        }