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]); }
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]); }