Top |
Functions
Description
GstQueueArray is an object that provides standard queue functionality based on an array instead of linked lists. This reduces the overhead caused by memory management by a large factor.
Functions
gst_queue_array_new ()
GstQueueArray *
gst_queue_array_new (guint initial_size
);
Allocates a new GstQueueArray object with an initial
queue size of initial_size
.
[skip]
Since: 1.2
gst_queue_array_free ()
void
gst_queue_array_free (GstQueueArray *array
);
Frees queue array
and all memory associated to it.
[skip]
Since: 1.2
gst_queue_array_get_length ()
guint
gst_queue_array_get_length (GstQueueArray *array
);
Returns the length of the queue array
[skip]
Since: 1.2
gst_queue_array_pop_head ()
gpointer
gst_queue_array_pop_head (GstQueueArray *array
);
Returns and head of the queue array
and removes
it from the queue.
[skip]
Since: 1.2
gst_queue_array_peek_head ()
gpointer
gst_queue_array_peek_head (GstQueueArray *array
);
Returns the head of the queue array
and does not
remove it from the queue.
[skip]
Since: 1.2
gst_queue_array_push_tail ()
void gst_queue_array_push_tail (GstQueueArray *array
,gpointer data
);
Pushes data
to the tail of the queue array
.
[skip]
Since: 1.2
gst_queue_array_pop_tail ()
gpointer
gst_queue_array_pop_tail (GstQueueArray *array
);
Returns the tail of the queue array
and removes
it from the queue.
[skip]
Since: 1.14
gst_queue_array_peek_tail ()
gpointer
gst_queue_array_peek_tail (GstQueueArray *array
);
Returns the tail of the queue array
, but does not remove it from the queue.
[skip]
Since: 1.14
gst_queue_array_is_empty ()
gboolean
gst_queue_array_is_empty (GstQueueArray *array
);
Checks if the queue array
is empty.
[skip]
Since: 1.2
gst_queue_array_drop_element ()
gpointer gst_queue_array_drop_element (GstQueueArray *array
,guint idx
);
Drops the queue element at position idx
from queue array
.
[skip]
Since: 1.2
gst_queue_array_find ()
guint gst_queue_array_find (GstQueueArray *array
,GCompareFunc func
,gpointer data
);
Finds an element in the queue array
, either by comparing every element
with func
or by looking up data
if no compare function func
is provided,
and returning the index of the found element.
Note that the index is not 0-based, but an internal index number with a
random offset. The index can be used in connection with
gst_queue_array_drop_element()
. FIXME: return index 0-based and make
gst_queue_array_drop_element()
take a 0-based index.
[skip]
Parameters
array |
a GstQueueArray object |
|
func |
comparison function, or |
[allow-none] |
data |
data for comparison function |
Since: 1.2
gst_queue_array_new_for_struct ()
GstQueueArray * gst_queue_array_new_for_struct (gsize struct_size
,guint initial_size
);
Allocates a new GstQueueArray object for elements (e.g. structures)
of size struct_size
, with an initial queue size of initial_size
.
[skip]
Parameters
struct_size |
Size of each element (e.g. structure) in the array |
|
initial_size |
Initial size of the new queue |
Since: 1.6
gst_queue_array_push_tail_struct ()
void gst_queue_array_push_tail_struct (GstQueueArray *array
,gpointer p_struct
);
gst_queue_array_peek_head_struct ()
gpointer
gst_queue_array_peek_head_struct (GstQueueArray *array
);
Returns the head of the queue array
without removing it from the queue.
[skip]
Returns
pointer to element or struct, or NULL if array
was empty. The
data pointed to by the returned pointer stays valid only as long as
the queue array is not modified further!
Since: 1.6
gst_queue_array_pop_head_struct ()
gpointer
gst_queue_array_pop_head_struct (GstQueueArray *array
);
Returns the head of the queue array
and removes it from the queue.
[skip]
Returns
pointer to element or struct, or NULL if array
was empty. The
data pointed to by the returned pointer stays valid only as long as
the queue array is not modified further!
Since: 1.6
gst_queue_array_peek_tail_struct ()
gpointer
gst_queue_array_peek_tail_struct (GstQueueArray *array
);
Returns the tail of the queue array
, but does not remove it from the queue.
[skip]
Since: 1.14
gst_queue_array_pop_tail_struct ()
gpointer
gst_queue_array_pop_tail_struct (GstQueueArray *array
);
Returns the tail of the queue array
and removes
it from the queue.
[skip]
Since: 1.14
gst_queue_array_drop_struct ()
gboolean gst_queue_array_drop_struct (GstQueueArray *array
,guint idx
,gpointer p_struct
);
Drops the queue element at position idx
from queue array
and copies the
data of the element or structure that was removed into p_struct
if
p_struct
is set (not NULL).
[skip]
Parameters
array |
a GstQueueArray object |
|
idx |
index to drop |
|
p_struct |
address into which to store the data of the dropped structure, or NULL |
Since: 1.6