public MMAL_WRAPPER_T( IntPtr userData, IntPtr callback, MMAL_COMPONENT_T *component, MMALUtil.MMAL_STATUS_T status, MMAL_PORT_T *control, uint inputNum, MMAL_PORT_T **input, MMAL_POOL_T **inputPool, uint outputNum, MMAL_PORT_T **output, MMAL_POOL_T **outputPool, MMAL_QUEUE_T **outputQueue, long timeSetup, long timeEnable, long timeDisable) { this.userData = userData; this.callback = callback; this.component = component; this.status = status; this.control = control; this.inputNum = inputNum; this.input = input; this.inputPool = inputPool; this.outputNum = outputNum; this.output = output; this.outputPool = outputPool; this.outputQueue = outputQueue; this.timeSetup = timeSetup; this.timeEnable = timeEnable; this.timeDisable = timeDisable; }
/// <summary> /// Checks whether the provided MMAL_STATUS_T is equal to MMAL_SUCCESS and throws the associated exception in case of an error. /// </summary> /// <param name="status">The MMAL_STATUS_T to search for an error.</param> /// <param name="message">The message for the exception that will be thrown if an error occurred.</param> /// <exception cref="MMALException"/> public static void MMALCheck(MMALUtil.MMAL_STATUS_T status, string message) { if (status != MMALUtil.MMAL_STATUS_T.MMAL_SUCCESS) { switch (status) { case MMALUtil.MMAL_STATUS_T.MMAL_ENOMEM: throw new MMALNoMemoryException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ENOSPC: throw new MMALNoSpaceException(message); case MMALUtil.MMAL_STATUS_T.MMAL_EINVAL: throw new MMALInvalidException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ENOSYS: throw new MMALNotImplementedException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ENOENT: throw new MMALInvalidDirectoryException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ENXIO: throw new MMALInvalidDeviceException(message); case MMALUtil.MMAL_STATUS_T.MMAL_EIO: throw new MMALIOException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ESPIPE: throw new MMALIllegalSeekException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ECORRUPT: throw new MMALCorruptException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ENOTREADY: throw new MMALComponentNotReadyException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ECONFIG: throw new MMALComponentNotConfiguredException(message); case MMALUtil.MMAL_STATUS_T.MMAL_EISCONN: throw new MMALPortConnectedException(message); case MMALUtil.MMAL_STATUS_T.MMAL_ENOTCONN: throw new MMALPortNotConnectedException(message); case MMALUtil.MMAL_STATUS_T.MMAL_EAGAIN: throw new MMALResourceUnavailableException(message); case MMALUtil.MMAL_STATUS_T.MMAL_EFAULT: throw new MMALBadAddressException(message); default: throw new MMALException(status, $"Unknown error occurred. {message}"); } } }
/// <summary> /// Creates a new instance of the <see cref="MMALException"/> class with the specified error code and message. /// This exception is the base class for all exception wrappers. /// </summary> /// <param name="status">The native status code.</param> /// <param name="message">The error message to print.</param> public MMALException(MMALUtil.MMAL_STATUS_T status, string message) : base(message) { }
public MMALException(MMALUtil.MMAL_STATUS_T status, string prefix) : base(prefix) { }