예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #4
0
 internal MMALBufferImpl Wait()
 {
     return(new MMALBufferImpl(MMALQueue.mmal_queue_wait(this.Ptr)));
 }
예제 #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);
        }
예제 #6
0
        internal static MMALQueueImpl Create()
        {
            var ptr = MMALQueue.mmal_queue_create();

            return(new MMALQueueImpl(ptr));
        }
예제 #7
0
 /// <summary>
 /// Destroy a queue of MMAL_BUFFER_HEADER_T.
 /// </summary>
 internal void Destroy()
 {
     MMALQueue.mmal_queue_destroy(this.Ptr);
 }
예제 #8
0
 internal void Put(MMALBufferImpl buffer)
 {
     MMALQueue.mmal_queue_put(this.Ptr, buffer.Ptr);
 }
예제 #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)));
 }
예제 #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)));
 }
예제 #11
0
 /// <summary>
 /// Destroy a queue of MMAL_BUFFER_HEADER_T.
 /// </summary>
 private void Destroy()
 {
     MMALQueue.mmal_queue_destroy(this.Ptr);
 }
예제 #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);
 }
예제 #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));
        }