Exemplo n.º 1
0
        /// <summary>
        /// Get a MMAL_BUFFER_HEADER_T from a queue.
        /// </summary>
        /// <param name="ptr">The queue to get a buffer from.</param>
        /// <returns>A new managed buffer header object.</returns>
        internal static MMALBufferImpl GetBuffer(MMAL_QUEUE_T *ptr)
        {
            var bufPtr = MMALQueue.mmal_queue_get(ptr);

            if (bufPtr == null || (IntPtr)bufPtr == IntPtr.Zero)
            {
                return(null);
            }

            return(new MMALBufferImpl(bufPtr));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get a MMAL_BUFFER_HEADER_T from a queue.
        /// </summary>
        /// <returns>A new managed buffer header object.</returns>
        internal MMALBufferImpl GetBuffer()
        {
            var ptr = MMALQueue.mmal_queue_get(this.Ptr);

            if (ptr == null || (IntPtr)ptr == IntPtr.Zero)
            {
                return(null);
            }

            return(new MMALBufferImpl(ptr));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get a MMAL_BUFFER_HEADER_T from a queue.
        /// </summary>
        /// <returns>A new managed buffer header object.</returns>
        internal MMALBufferImpl GetBuffer()
        {
            var ptr = MMALQueue.mmal_queue_get(this.Ptr);

            if (!this.CheckState())
            {
                MMALLog.Logger.Warn("Buffer retrieved null.");
                return(null);
            }

            return(new MMALBufferImpl(ptr));
        }
Exemplo n.º 4
0
 internal MMALBufferImpl Wait()
 {
     return(new MMALBufferImpl(MMALQueue.mmal_queue_wait(this.Ptr)));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Get the number of MMAL_BUFFER_HEADER_T currently in a queue.
        /// </summary>
        /// <returns>The number of buffers currently in this queue.</returns>
        internal uint QueueLength()
        {
            var length = MMALQueue.mmal_queue_length(this.Ptr);

            return(length);
        }
Exemplo n.º 6
0
        internal static MMALQueueImpl Create()
        {
            var ptr = MMALQueue.mmal_queue_create();

            return(new MMALQueueImpl(ptr));
        }
Exemplo n.º 7
0
 /// <summary>
 /// Destroy a queue of MMAL_BUFFER_HEADER_T.
 /// </summary>
 internal void Destroy()
 {
     MMALQueue.mmal_queue_destroy(this.Ptr);
 }
Exemplo n.º 8
0
 internal void Put(MMALBufferImpl buffer)
 {
     MMALQueue.mmal_queue_put(this.Ptr, buffer.Ptr);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Waits (blocking) for a buffer header to be available in the queue and allocates it. This is the same as a wait, except that it will abort in case of timeout.
 /// </summary>
 /// <param name="waitms">Number of milliseconds to wait before aborting.</param>
 /// <returns>The buffer header.</returns>
 public IBuffer TimedWait(int waitms)
 {
     return(new MMALBufferImpl(MMALQueue.mmal_queue_timedwait(this.Ptr, waitms)));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Waits (blocking) for a buffer header to be available in the queue and allocates it.
 /// </summary>
 /// <returns>The buffer header.</returns>
 public IBuffer Wait()
 {
     return(new MMALBufferImpl(MMALQueue.mmal_queue_wait(this.Ptr)));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Destroy a queue of MMAL_BUFFER_HEADER_T.
 /// </summary>
 private void Destroy()
 {
     MMALQueue.mmal_queue_destroy(this.Ptr);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Puts the buffer header back into this queue.
 /// </summary>
 /// <param name="buffer">The buffer header.</param>
 public void Put(IBuffer buffer)
 {
     MMALQueue.mmal_queue_put(this.Ptr, buffer.Ptr);
 }
Exemplo n.º 13
0
        /// <summary>
        /// Get a MMAL_BUFFER_HEADER_T from a queue
        /// </summary>
        /// <returns></returns>
        internal MMALBufferImpl GetBuffer()
        {
            var ptr = MMALQueue.mmal_queue_get(this.Ptr);

            return(new MMALBufferImpl(ptr));
        }