/// <summary> /// Disable a connection. /// </summary> internal void Disable() { if (Enabled) { MMALCheck(MMALConnection.mmal_connection_disable(this.Ptr), "Unable to disable connection"); } }
/// <summary> /// Enable a connection. The format of the two ports must have been committed before calling this function, although note that on creation, /// the connection automatically copies and commits the output port's format to the input port. /// </summary> internal void Enable() { if (!Enabled) { MMALCheck(MMALConnection.mmal_connection_enable(this.Ptr), "Unable to enable connection"); } }
/// <summary> /// Facility to create a connection between two port objects /// </summary> /// <param name="output">The output port of the connection</param> /// <param name="input">The input port of the connection</param> /// <returns></returns> internal static MMALConnectionImpl CreateConnection(MMALPortBase output, MMALPortBase input, MMALDownstreamComponent inputComponent) { IntPtr ptr = IntPtr.Zero; MMALCheck(MMALConnection.mmal_connection_create(&ptr, output.Ptr, input.Ptr, MMALConnection.MMAL_CONNECTION_FLAG_TUNNELLING | MMALConnection.MMAL_CONNECTION_FLAG_ALLOCATION_ON_INPUT), "Unable to create connection"); return(new MMALConnectionImpl((MMAL_CONNECTION_T *)ptr, output, input, inputComponent, output.ComponentReference)); }
/// <summary> /// Destroy a connection. Release an acquired reference on a connection. Only actually destroys the connection when the last reference is /// being released. The actual destruction of the connection will start by disabling it, if necessary. Any pool, queue, and so on owned by /// the connection shall then be destroyed. /// </summary> internal void Destroy() { //Cleaning port pools for sanity. this.UpstreamComponent.CleanPortPools(); this.DownstreamComponent.CleanPortPools(); MMALCheck(MMALConnection.mmal_connection_destroy(this.Ptr), "Unable to destroy connection"); }
/// <summary> /// Disable a connection. /// </summary> public void Disable() { if (this.Enabled) { MMALLog.Logger.LogDebug($"Disabling connection between {this.OutputPort.Name} and {this.InputPort.Name}"); MMALCheck(MMALConnection.mmal_connection_disable(this.Ptr), "Unable to disable connection"); } }
/// <summary> /// Facility to create a connection between two port objects. /// </summary> /// <param name="output">The output port of the connection.</param> /// <param name="input">The input port of the connection.</param> /// <param name="inputComponent">The managed instance of the component we are connecting to.</param> /// <param name="useCallback">When set to true, enable the connection callback delegate (adversely affects performance).</param> /// <returns>A new managed connection object.</returns> internal static MMALConnectionImpl CreateConnection(IOutputPort output, IInputPort input, IDownstreamComponent inputComponent, bool useCallback) { IntPtr ptr = IntPtr.Zero; if (useCallback) { MMALCheck(MMALConnection.mmal_connection_create(&ptr, output.Ptr, input.Ptr, MMALConnection.MMAL_CONNECTION_FLAG_ALLOCATION_ON_INPUT), "Unable to create connection"); } else { MMALCheck(MMALConnection.mmal_connection_create(&ptr, output.Ptr, input.Ptr, MMALConnection.MMAL_CONNECTION_FLAG_TUNNELLING | MMALConnection.MMAL_CONNECTION_FLAG_ALLOCATION_ON_INPUT), "Unable to create connection"); } return(new MMALConnectionImpl((MMAL_CONNECTION_T *)ptr, output, input, inputComponent, output.ComponentReference, useCallback)); }