Commit 379d5dfb authored by Sebastian Dröge's avatar Sebastian Dröge

bufferlist: Add boxed type for GstBufferListIterator for gobject-introspection

parent 2d7c81f1
......@@ -756,6 +756,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
_gst_event_initialize ();
_gst_buffer_initialize ();
_gst_buffer_list_initialize ();
gst_buffer_list_iterator_get_type ();
_gst_message_initialize ();
_gst_tag_initialize ();
gst_parse_context_get_type ();
......
......@@ -425,6 +425,33 @@ gst_buffer_list_get (GstBufferList * list, guint group, guint idx)
return NULL;
}
static GstBufferListIterator *
gst_buffer_list_iterator_copy (const GstBufferListIterator * it)
{
GstBufferListIterator *ret;
ret = g_slice_new (GstBufferListIterator);
ret->list = it->list;
ret->next = it->next;
ret->last_returned = it->last_returned;
return ret;
}
GType
gst_buffer_list_iterator_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
type = g_boxed_type_register_static ("GstBufferListIterator",
(GBoxedCopyFunc) gst_buffer_list_iterator_copy,
(GBoxedFreeFunc) gst_buffer_list_iterator_free);
}
return type;
}
/**
* gst_buffer_list_iterate:
* @list: a #GstBufferList
......
......@@ -35,6 +35,8 @@ G_BEGIN_DECLS
#define GST_BUFFER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BUFFER_LIST, GstBufferListClass))
#define GST_BUFFER_LIST_CAST(obj) ((GstBufferList *)obj)
#define GST_TYPE_BUFFER_LIST_ITERATOR (gst_buffer_list_iterator_get_type ())
typedef struct _GstBufferList GstBufferList;
typedef struct _GstBufferListClass GstBufferListClass;
typedef struct _GstBufferListIterator GstBufferListIterator;
......@@ -215,6 +217,7 @@ void gst_buffer_list_foreach (GstBufferList *l
GstBuffer * gst_buffer_list_get (GstBufferList *list, guint group, guint idx);
/* iterator */
GType gst_buffer_list_iterator_get_type (void);
GstBufferListIterator * gst_buffer_list_iterate (GstBufferList *list);
void gst_buffer_list_iterator_free (GstBufferListIterator *it);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment