My Project
Typedefs | Functions
Queues of buffer headers

Typedefs

typedef struct MMAL_QUEUE_T MMAL_QUEUE_T

Functions

MMAL_QUEUE_Tmmal_queue_create (void)
void mmal_queue_put (MMAL_QUEUE_T *queue, MMAL_BUFFER_HEADER_T *buffer)
void mmal_queue_put_back (MMAL_QUEUE_T *queue, MMAL_BUFFER_HEADER_T *buffer)
MMAL_BUFFER_HEADER_Tmmal_queue_get (MMAL_QUEUE_T *queue)
MMAL_BUFFER_HEADER_Tmmal_queue_wait (MMAL_QUEUE_T *queue)
unsigned int mmal_queue_length (MMAL_QUEUE_T *queue)
void mmal_queue_destroy (MMAL_QUEUE_T *queue)

Detailed Description

This provides a thread-safe implementation of a queue of buffer headers (MMAL_BUFFER_HEADER_T). The queue works in a first-in, first-out basis so the buffer headers will be dequeued in the order they have been queued.


Function Documentation

Create a queue of MMAL_BUFFER_HEADER_T

Returns:
Pointer to the newly created queue or NULL on failure.

Create a QUEUE of MMAL_BUFFER_HEADER_T

void mmal_queue_destroy ( MMAL_QUEUE_T queue)

Destroy a queue of MMAL_BUFFER_HEADER_T.

Parameters:
queuePointer to a queue

Destroy a queue of MMAL_BUFFER_HEADER_T

Get a MMAL_BUFFER_HEADER_T from a queue

Parameters:
queuePointer to a queue
Returns:
pointer to the next MMAL_BUFFER_HEADER_T or NULL if the queue is empty.

Get a MMAL_BUFFER_HEADER_T from a QUEUE.

unsigned int mmal_queue_length ( MMAL_QUEUE_T queue)

Get the number of MMAL_BUFFER_HEADER_T currently in a queue.

Parameters:
queuePointer to a queue
Returns:
length (in elements) of the queue.

Get the number of MMAL_BUFFER_HEADER_T currently in a QUEUE

void mmal_queue_put ( MMAL_QUEUE_T queue,
MMAL_BUFFER_HEADER_T buffer 
)

Put a MMAL_BUFFER_HEADER_T into a queue

Parameters:
queuePointer to a queue
bufferPointer to the MMAL_BUFFER_HEADER_T to add to the queue

Put a MMAL_BUFFER_HEADER_T into a QUEUE

void mmal_queue_put_back ( MMAL_QUEUE_T queue,
MMAL_BUFFER_HEADER_T buffer 
)

Put a MMAL_BUFFER_HEADER_T back at the start of a queue. This is used when a buffer header was removed from the queue but not fully processed and needs to be put back where it was originally taken.

Parameters:
queuePointer to a queue
bufferPointer to the MMAL_BUFFER_HEADER_T to add to the queue

Put a MMAL_BUFFER_HEADER_T back at the start of a QUEUE.

Wait for a MMAL_BUFFER_HEADER_T from a queue. This is the same as a get except that this will block until a buffer header is available.

Parameters:
queuePointer to a queue
Returns:
pointer to the next MMAL_BUFFER_HEADER_T.

Wait for a MMAL_BUFFER_HEADER_T from a QUEUE.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines