gst_dmabuf_allocator_new
gst_dmabuf_allocator_alloc
gst_dmabuf_memory_get_fd
+gst_dmabuf_allocator_get_type
gst_is_dmabuf_memory
<SUBSECTION Standard>
+GstDmaBufAllocator
+GstDmaBufAllocatorClass
GST_ALLOCATOR_DMABUF
+GST_DMABUF_ALLOCATOR
+GST_DMABUF_ALLOCATOR_CAST
+GST_DMABUF_ALLOCATOR_CLASS
+GST_DMABUF_ALLOCATOR_GET_CLASS
+GST_IS_DMABUF_ALLOCATOR
+GST_IS_DMABUF_ALLOCATOR_CLASS
+GST_TYPE_DMABUF_ALLOCATOR
<SUBSECTION Private>
</SECTION>
GST_DEBUG_CATEGORY_STATIC (dmabuf_debug);
#define GST_CAT_DEFAULT dmabuf_debug
-typedef struct
-{
- GstFdAllocator parent;
-} GstDmaBufAllocator;
-
-typedef struct
-{
- GstFdAllocatorClass parent_class;
-} GstDmaBufAllocatorClass;
-
-GType dmabuf_mem_allocator_get_type (void);
-G_DEFINE_TYPE (GstDmaBufAllocator, dmabuf_mem_allocator, GST_TYPE_FD_ALLOCATOR);
-
-#define GST_TYPE_DMABUF_ALLOCATOR (dmabuf_mem_allocator_get_type())
-#define GST_IS_DMABUF_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DMABUF_ALLOCATOR))
+G_DEFINE_TYPE (GstDmaBufAllocator, gst_dmabuf_allocator, GST_TYPE_FD_ALLOCATOR);
static void
-dmabuf_mem_allocator_class_init (GstDmaBufAllocatorClass * klass)
+gst_dmabuf_allocator_class_init (GstDmaBufAllocatorClass * klass)
{
}
static void
-dmabuf_mem_allocator_init (GstDmaBufAllocator * allocator)
+gst_dmabuf_allocator_init (GstDmaBufAllocator * allocator)
{
GstAllocator *alloc = GST_ALLOCATOR_CAST (allocator);
gboolean
gst_is_dmabuf_memory (GstMemory * mem)
{
- return gst_memory_is_type (mem, GST_ALLOCATOR_DMABUF);
+ g_return_val_if_fail (mem != NULL, FALSE);
+
+ return GST_IS_DMABUF_ALLOCATOR (mem->allocator);
}
#define __GST_DMABUF_H__
#include <gst/gst.h>
+#include <gst/allocators/gstfdmemory.h>
G_BEGIN_DECLS
#define GST_ALLOCATOR_DMABUF "dmabuf"
+#define GST_TYPE_DMABUF_ALLOCATOR (gst_dmabuf_allocator_get_type())
+#define GST_IS_DMABUF_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DMABUF_ALLOCATOR))
+#define GST_IS_DMABUF_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DMABUF_ALLOCATOR))
+#define GST_DMABUF_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DMABUF_ALLOCATOR, GstDmaBufAllocatorClass))
+#define GST_DMABUF_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DMABUF_ALLOCATOR, GstDmaBufAllocator))
+#define GST_DMABUF_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DMABUF_ALLOCATOR, GstDmaBufAllocatorClass))
+#define GST_DMABUF_ALLOCATOR_CAST(obj) ((GstDmaBufAllocator *)(obj))
+
+typedef struct _GstDmaBufAllocator GstDmaBufAllocator;
+typedef struct _GstDmaBufAllocatorClass GstDmaBufAllocatorClass;
+
+/**
+ * GstDmaBufAllocator:
+ *
+ * Base class for allocators with dmabuf-backed memory
+ *
+ * Since: 1.12
+ */
+struct _GstDmaBufAllocator
+{
+ GstFdAllocator parent;
+};
+
+struct _GstDmaBufAllocatorClass
+{
+ GstFdAllocatorClass parent_class;
+};
+
+
+GType gst_dmabuf_allocator_get_type (void);
+
GstAllocator * gst_dmabuf_allocator_new (void);
GstMemory * gst_dmabuf_allocator_alloc (GstAllocator * allocator, gint fd, gsize size);
gboolean gst_is_dmabuf_memory (GstMemory * mem);
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstDmaBufAllocator, gst_object_unref)
+#endif
+
G_END_DECLS
#endif /* __GST_DMABUF_H__ */