mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
plugins: add init/clear functions to GstQueueArray
This commit is contained in:
parent
94f6ba9c0b
commit
2b17de7504
2 changed files with 21 additions and 5 deletions
|
@ -23,17 +23,24 @@
|
|||
#include <gst/gst.h>
|
||||
#include "gstqueuearray.h"
|
||||
|
||||
GstQueueArray *
|
||||
gst_queue_array_new (guint initial_size)
|
||||
void
|
||||
gst_queue_array_init (GstQueueArray * array, guint initial_size)
|
||||
{
|
||||
GstQueueArray *array = g_malloc (sizeof (GstQueueArray));
|
||||
|
||||
array->size = initial_size;
|
||||
array->array = g_new0 (gpointer, initial_size);
|
||||
array->head = 0;
|
||||
array->tail = 0;
|
||||
array->length = 0;
|
||||
|
||||
}
|
||||
|
||||
GstQueueArray *
|
||||
gst_queue_array_new (guint initial_size)
|
||||
{
|
||||
GstQueueArray *array;
|
||||
|
||||
array = g_new (GstQueueArray, 1);
|
||||
gst_queue_array_init (array, initial_size);
|
||||
return array;
|
||||
}
|
||||
|
||||
|
@ -102,9 +109,15 @@ gst_queue_array_is_empty (GstQueueArray * array)
|
|||
}
|
||||
|
||||
void
|
||||
gst_queue_array_free (GstQueueArray * array)
|
||||
gst_queue_array_clear (GstQueueArray * array)
|
||||
{
|
||||
g_free (array->array);
|
||||
}
|
||||
|
||||
void
|
||||
gst_queue_array_free (GstQueueArray * array)
|
||||
{
|
||||
gst_queue_array_clear (array);
|
||||
g_free (array);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,9 @@ struct _GstQueueArray
|
|||
guint length;
|
||||
};
|
||||
|
||||
void gst_queue_array_init (GstQueueArray * array, guint initial_size);
|
||||
void gst_queue_array_clear (GstQueueArray * array);
|
||||
|
||||
GstQueueArray *gst_queue_array_new (guint initial_size);
|
||||
gpointer gst_queue_array_pop_head (GstQueueArray * array);
|
||||
void gst_queue_array_push_tail (GstQueueArray * array, gpointer data);
|
||||
|
|
Loading…
Reference in a new issue