Example #1
0
        // Add new camera to the collection and run it
        public bool Add(CameraPlay camwin, DeviceInfo deviceInfo, CameraInfo camera)
        {
            // create video source

            IVideoSource videoSource=  DeviceBusiness.Instance.CreateVideoSource(deviceInfo.ProviderName);
            if (videoSource == null)
            {
                return false;
            }
            DeviceDriver device = new DeviceDriver(videoSource);
            if (!RunningDeviceList.ContainsKey(deviceInfo.DeviceId))
            {
                deviceInfo.ServiceID = -1;
                device.Init(ref deviceInfo);
                RunningDeviceList.Add(deviceInfo.DeviceId, deviceInfo);
                RunningDriverList.Add(camera.CameraId, device);

            }
            else
            {
                deviceInfo = RunningDeviceList[deviceInfo.DeviceId];
                device.Init(ref deviceInfo);

                RunningDriverList.Add(camera.CameraId, device);
            }

            device.Start(ref camera);
            camwin.Camera = device;
            return true;
        }
Example #2
0
 // Set camera to the specified position of the multiplexer
 public CameraPlay SetCamera(int row, int col, DeviceDriver camera)
 {
     if ((row >= 0) && (col >= 0) && (row < MaxRows) && (col < MaxCols))
     {
         camWindows[row, col].Camera = camera;
         return camWindows[row, col];
     }
     return null;
 }