Beispiel #1
0
        public static void GetDevices(ref Dictionary <string, IVideoSource> deviceCache)
        {
            for (int i = 0; i < PSEyeSource.CameraCount; i++)
            {
                var camName = string.Format("PsEye_{0}", i + 1);

                lock (deviceCache)
                {
                    if (deviceCache.ContainsKey(camName))
                    {
                        continue;
                    }
                    //else .. all other code

                    try
                    {
                        var video = new PSEyeSource(PSEyeSource.CameraUUID(i))
                        {
                            Name = camName
                        };

                        deviceCache.Add(camName, video);
                    }
                    catch (Exception e)
                    {
                        System.Windows.Forms.MessageBox.Show(string.Join(Environment.NewLine, e.Message, "", e.Source, "", e.StackTrace));
                    }
                }
            }
        }
Beispiel #2
0
 public void Search()
 {
     //AforgeVideoSourceLite.GetDevices(ref DeviceCache);	//FIX: use this if you have problems with device .. it uses only base directshow calls. No device capabilityList
     PSEyeSource.GetDevices(ref DeviceCache);
     AforgeVideoSource.GetDevices(ref DeviceCache);
     FileVideoSource.GetDevices(ref DeviceCache);
 }