|  |  |  | GStreamer 1.0 Core Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
#include <gst/gst.h>
                    GstAtomicQueue;
GstAtomicQueue *    gst_atomic_queue_new                (guint initial_size);
void                gst_atomic_queue_ref                (GstAtomicQueue *queue);
void                gst_atomic_queue_unref              (GstAtomicQueue *queue);
void                gst_atomic_queue_push               (GstAtomicQueue *queue,
                                                         gpointer data);
gpointer            gst_atomic_queue_peek               (GstAtomicQueue *queue);
gpointer            gst_atomic_queue_pop                (GstAtomicQueue *queue);
guint               gst_atomic_queue_length             (GstAtomicQueue *queue);
The GstAtomicQueue object implements a queue that can be used from multiple threads without performing any blocking operations.
typedef struct _GstAtomicQueue GstAtomicQueue;
Opaque atomic data queue.
Use the acessor functions to get the stored values.
GstAtomicQueue *    gst_atomic_queue_new                (guint initial_size);
Create a new atomic queue instance. initial_size will be rounded up to the
nearest power of 2 and used as the initial size of the queue.
| 
 | initial queue size | 
| Returns : | a new GstAtomicQueue | 
void                gst_atomic_queue_ref                (GstAtomicQueue *queue);
Increase the refcount of queue.
| 
 | a GstAtomicQueue | 
void                gst_atomic_queue_unref              (GstAtomicQueue *queue);
Unref queue and free the memory when the refcount reaches 0.
| 
 | a GstAtomicQueue | 
void gst_atomic_queue_push (GstAtomicQueue *queue,gpointer data);
Append data to the tail of the queue.
| 
 | a GstAtomicQueue | 
| 
 | the data | 
gpointer            gst_atomic_queue_peek               (GstAtomicQueue *queue);
Peek the head element of the queue without removing it from the queue.
| 
 | a GstAtomicQueue | 
| Returns : | the head element of queueor NULL when
the queue is empty. [transfer none] | 
gpointer            gst_atomic_queue_pop                (GstAtomicQueue *queue);
Get the head element of the queue.
| 
 | a GstAtomicQueue | 
| Returns : | the head element of queueor NULL when
the queue is empty. [transfer full] | 
guint               gst_atomic_queue_length             (GstAtomicQueue *queue);
Get the amount of items in the queue.
| 
 | a GstAtomicQueue | 
| Returns : | the number of elements in the queue. |