Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 23 + Name.GetHashCode();
            hash = hash * 23 + IP.GetHashCode();
            hash = hash * 23 + ControlPort.GetHashCode();

            return(hash);
        }
        protected MmalComponentBase(string name)
        {
            Ptr = CreateComponent(name);

            Inputs  = new List <IInputPort>();
            Outputs = new List <IOutputPort>();
            Clocks  = new List <IPort>();
            Ports   = new List <IPort>();

            Control = new ControlPort((IntPtr)Ptr->Control, this, Guid.NewGuid());

            for (var i = 0; i < Ptr->ClockNum; i++)
            {
                Clocks.Add(new ClockPort((IntPtr)(&(*Ptr->Clock[i])), this, Guid.NewGuid()));
            }

            for (var i = 0; i < Ptr->PortNum; i++)
            {
                Ports.Add(new GenericPort((IntPtr)(&(*Ptr->Port[i])), this, PortType.Generic, Guid.NewGuid()));
            }
        }
Esempio n. 3
0
 public void ShutDown()
 {
     if (ControlPort != null)
     {
         ControlPort.Close();
         ControlPort = null;
     }
     if (PhotoPort != null)
     {
         PhotoPort.Close();
         PhotoPort = null;
     }
     if (VideoPort != null)
     {
         VideoPort.Close();
         VideoPort = null;
     }
     if (HeartPort != null)
     {
         HeartPort.Close();
         HeartPort = null;
     }
 }