Exemplo n.º 1
0
 /// <summary>
 /// Connect to the automation interface/controller device.
 /// </summary>
 public bool Connect()
 {
     if (cameraSource != IntPtr.Zero)
     {
         Disconnect();
     }
     if (this.GetOption("Configuration") != null && !string.IsNullOrEmpty(this.GetOption("Configuration").Value))
     {
         var config = this.GetOption("Configuration").Value.Split(',');
         SetConfiguration(config[0], uint.Parse(config[1]), uint.Parse(config[2]), uint.Parse(config[3]));
     }
     cameraSource = CameraCaptureV4LInterop.OpenCameraStream(configuration.Device, configuration.Width, configuration.Height, configuration.Fps);
     if (InterfaceModulesChangedAction != null)
     {
         InterfaceModulesChangedAction(new InterfaceModulesChangedAction()
         {
             Domain = this.Domain
         });
     }
     //
     InterfacePropertyChangedAction(new InterfacePropertyChangedAction()
     {
         Domain     = this.Domain,
         SourceId   = "AV0",
         SourceType = "Camera Input",
         Path       = "Widget.DisplayModule",
         Value      = "homegenie/generic/camerainput"
     });
     //
     return(cameraSource != IntPtr.Zero);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Connect to the automation interface/controller device.
 /// </summary>
 public bool Connect()
 {
     if (_camerasource != IntPtr.Zero)
     {
         Disconnect();
     }
     _camerasource = CameraCaptureV4LInterop.OpenCameraStream("/dev/video0", 320, 240, 3);
     return(_camerasource != IntPtr.Zero);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Connect to the automation interface/controller device.
 /// </summary>
 public bool Connect()
 {
     if (cameraSource != IntPtr.Zero)
     {
         Disconnect();
     }
     if (this.GetOption("Configuration") != null && !string.IsNullOrEmpty(this.GetOption("Configuration").Value))
     {
         var config = this.GetOption("Configuration").Value.Split(',');
         SetConfiguration(config[0], uint.Parse(config[1]), uint.Parse(config[2]), uint.Parse(config[3]));
     }
     cameraSource = CameraCaptureV4LInterop.OpenCameraStream(configuration.Device, configuration.Width, configuration.Height, configuration.Fps);
     OnInterfaceModulesChanged(this.GetDomain());
     // TODO: Possibly move this event out of here... it's a HomeGenie specific event
     OnInterfacePropertyChanged(this.GetDomain(), "AV0", "Camera Input", "Widget.DisplayModule", "homegenie/generic/camerainput");
     return(cameraSource != IntPtr.Zero);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Connect to the automation interface/controller device.
        /// </summary>
        public bool Connect()
        {
            if (cameraSource != IntPtr.Zero)
            {
                Disconnect();
            }

            /*SetVideoInput(
             *  this.GetOption("Device"),
             *  this.GetOption("Width"),
             *  this.GetOption("Height"),
             *  this.GetOption("Fps")
             * );*/
            cameraSource = CameraCaptureV4LInterop.OpenCameraStream(videoInput.Device, videoInput.Width, videoInput.Height, videoInput.Fps);
            if (InterfaceModulesChangedAction != null)
            {
                InterfaceModulesChangedAction(new InterfaceModulesChangedAction()
                {
                    Domain = this.Domain
                });
            }
            return(cameraSource != IntPtr.Zero);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Connect to the automation interface/controller device.
        /// </summary>
        /// <returns>boolean value indicating the status</returns>
        public bool Connect()
        {
            Log.Debug($"{this.GetDomain()} Connecting");
            if (this.cameraSource != IntPtr.Zero)
            {
                Log.Debug($"{this.GetDomain()} invalid camera source");

                this.Disconnect();
            }

            if (this.GetOption("Configuration") != null && !string.IsNullOrEmpty(this.GetOption("Configuration").Value))
            {
                var config = this.GetOption("Configuration").Value.Split(',');
                this.SetConfiguration(config[0], uint.Parse(config[1]), uint.Parse(config[2]), uint.Parse(config[3]));
            }

            Log.Debug($"{this.GetDomain()} Opening camera stream on {this.configuration.Device}");
            this.cameraSource = CameraCaptureV4LInterop.OpenCameraStream(this.configuration.Device, this.configuration.Width, this.configuration.Height, this.configuration.Fps);
            this.OnInterfaceModulesChanged(this.GetDomain());

            this.OnInterfacePropertyChanged(this.GetDomain(), "AV0", "Camera Input", "Widget.DisplayModule", "homegenie/generic/camerainput");

            return(this.cameraSource != IntPtr.Zero);
        }