mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-09 17:44:14 +00:00
queuearray: Implement pop_tail_struct() for completeness
All other variants of {peek,pop}_{head,tail}_{,struct} were already implemented. https://bugzilla.gnome.org/show_bug.cgi?id=794035
This commit is contained in:
parent
a1bf0f0e6a
commit
89eac59e92
4 changed files with 39 additions and 0 deletions
docs/libs
libs/gst/base
win32/common
|
@ -938,6 +938,7 @@ gst_queue_array_push_tail_struct
|
|||
gst_queue_array_peek_head_struct
|
||||
gst_queue_array_pop_head_struct
|
||||
gst_queue_array_peek_tail_struct
|
||||
gst_queue_array_pop_tail_struct
|
||||
gst_queue_array_drop_struct
|
||||
</SECTION>
|
||||
|
||||
|
|
|
@ -401,6 +401,41 @@ gst_queue_array_pop_tail (GstQueueArray * array)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_queue_array_pop_tail_struct: (skip)
|
||||
* @array: a #GstQueueArray object
|
||||
*
|
||||
* Returns the tail of the queue @array and removes
|
||||
* it from the queue.
|
||||
*
|
||||
* Returns: The tail of the queue
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
gpointer
|
||||
gst_queue_array_pop_tail_struct (GstQueueArray * array)
|
||||
{
|
||||
gpointer ret;
|
||||
guint len, idx;
|
||||
|
||||
g_return_val_if_fail (array != NULL, NULL);
|
||||
|
||||
len = array->length;
|
||||
|
||||
/* empty array */
|
||||
if (len == 0)
|
||||
return NULL;
|
||||
|
||||
idx = (array->head + (len - 1)) % array->size;
|
||||
|
||||
ret = array->array + (array->elt_size * idx);
|
||||
|
||||
array->tail = idx;
|
||||
array->length--;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_queue_array_is_empty: (skip)
|
||||
* @array: a #GstQueueArray object
|
||||
|
|
|
@ -84,6 +84,8 @@ gboolean gst_queue_array_drop_struct (GstQueueArray * array,
|
|||
guint idx,
|
||||
gpointer p_struct);
|
||||
GST_EXPORT
|
||||
gpointer gst_queue_array_pop_tail_struct (GstQueueArray * array);
|
||||
GST_EXPORT
|
||||
gpointer gst_queue_array_peek_tail_struct (GstQueueArray * array);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -321,6 +321,7 @@ EXPORTS
|
|||
gst_queue_array_pop_head
|
||||
gst_queue_array_pop_head_struct
|
||||
gst_queue_array_pop_tail
|
||||
gst_queue_array_pop_tail_struct
|
||||
gst_queue_array_push_tail
|
||||
gst_queue_array_push_tail_struct
|
||||
gst_type_find_helper
|
||||
|
|
Loading…
Reference in a new issue