mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
iterator: register as a boxed type
https://bugzilla.gnome.org/show_bug.cgi?id=638987
This commit is contained in:
parent
b5a4aad134
commit
62c7339847
2 changed files with 21 additions and 0 deletions
|
@ -71,6 +71,23 @@
|
||||||
#include "gst_private.h"
|
#include "gst_private.h"
|
||||||
#include <gst/gstiterator.h>
|
#include <gst/gstiterator.h>
|
||||||
|
|
||||||
|
static GstIterator *
|
||||||
|
gst_iterator_copy (GstIterator * it)
|
||||||
|
{
|
||||||
|
return g_slice_copy (it->size, it);
|
||||||
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gst_iterator_get_type (void)
|
||||||
|
{
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (type == 0))
|
||||||
|
type = g_boxed_type_register_static ("GstIterator",
|
||||||
|
(GBoxedCopyFunc) gst_iterator_copy, (GBoxedFreeFunc) gst_iterator_free);
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_iterator_init (GstIterator * it,
|
gst_iterator_init (GstIterator * it,
|
||||||
guint size,
|
guint size,
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GST_TYPE_ITERATOR (gst_iterator_get_type ())
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstIteratorResult:
|
* GstIteratorResult:
|
||||||
* @GST_ITERATOR_DONE: No more items in the iterator
|
* @GST_ITERATOR_DONE: No more items in the iterator
|
||||||
|
@ -222,6 +224,8 @@ struct _GstIterator {
|
||||||
gpointer _gst_reserved[GST_PADDING-1];
|
gpointer _gst_reserved[GST_PADDING-1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GType gst_iterator_get_type (void);
|
||||||
|
|
||||||
/* creating iterators */
|
/* creating iterators */
|
||||||
GstIterator* gst_iterator_new (guint size,
|
GstIterator* gst_iterator_new (guint size,
|
||||||
GType type,
|
GType type,
|
||||||
|
|
Loading…
Reference in a new issue