Exemplo n.º 1
0
        public MMALPortBase ConnectTo(MMALDownstreamComponent destinationComponent, int inputPort = 0)
        {
            if (MMALCamera.Instance.Connections.Any(c => c.UpstreamComponent == this.ComponentReference &&
                                                    c.DownstreamComponent == destinationComponent))
            {
                MMALLog.Logger.Warn("A connection has already been established between these components");
                return(destinationComponent.Inputs[inputPort]);
            }

            var connection = MMALConnectionImpl.CreateConnection(this, destinationComponent.Inputs[inputPort], destinationComponent);

            MMALCamera.Instance.Connections.Add(connection);

            return(destinationComponent.Inputs[inputPort]);
        }
Exemplo n.º 2
0
        public MMALPortBase ConnectTo(MMALDownstreamComponent destinationComponent, int inputPort = 0, bool useCallback = false)
        {
            if (this.ConnectedReference != null)
            {
                MMALLog.Logger.Warn("A connection has already been established on this port");
                return(destinationComponent.Inputs[inputPort]);
            }

            var connection = MMALConnectionImpl.CreateConnection(this, destinationComponent.Inputs[inputPort], destinationComponent, useCallback);

            this.ConnectedReference = connection;
            destinationComponent.Inputs[inputPort].ConnectedReference = connection;

            return(destinationComponent.Inputs[inputPort]);
        }