//Get the next buffer from the queue.If* block* is ``True`` (the default) //and* timeout* is ``None`` (the default) then the method will block //until a buffer is available.Otherwise* timeout* is the maximum time to //wait(in seconds) for a buffer to become available.If a buffer is not //available before the timeout expires, the method returns ``None``. //Likewise, if *block* is ``False`` and no buffer is immediately //available then ``None`` is returned. public MMalBuffer Get(bool block = true, int timeout = 0) { MMal.MMAL_BUFFER_HEADER_T *buf = null; if (block && timeout == 0) { buf = MMal.mmal_queue_wait(_queue); } else if (block && timeout != 0) { buf = MMal.mmal_queue_timedwait(_queue, (uint)(timeout * 1000)); } else { buf = MMal.mmal_queue_get(_queue); } if (buf != null) { return(new MMalBuffer(buf)); } else { return(null); } }
public MMalBuffer(MMal.MMAL_BUFFER_HEADER_T *buf) { _buf = buf; Length = (int)_buf->length; Timestamp = _buf->pts; Flags = _buf->flags; _buffer = new byte[Length]; byte *p = (byte *)_buf->data; for (int i = 0; i < Length; i++) { _buffer[i] = p[i]; } }
private void ControlCallback(MMal.MMAL_PORT_T *port, MMal.MMAL_BUFFER_HEADER_T *buffer) { throw new NotImplementedException(); }