/// <summary> /// Disable processing on a port. Disabling a port will stop all processing on this port and return all (non-processed) /// buffer headers to the client. If this is a connected output port, the input port to which it is connected shall also be disabled. /// Any buffer pool shall be released. /// </summary> internal void DisablePort() { if (Enabled) { MMALLog.Logger.Debug("Disabling port"); var length = this.BufferPool.Queue.QueueLength(); for (int i = 0; i < length; i++) { MMALLog.Logger.Debug("Releasing active buffer"); var buffer = this.BufferPool.Queue.GetBuffer(); buffer.Release(); } MMALCheck(MMALPort.mmal_port_disable(this.Ptr), "Unable to disable port."); } }