* Since: 1.2
*/
+#ifdef HAVE_MMAP
#include <sys/mman.h>
#include <unistd.h>
+#endif
/*
* GstDmaBufMemory
static void
gst_dmabuf_allocator_free (GstAllocator * allocator, GstMemory * gmem)
{
+#ifdef HAVE_MMAP
GstDmaBufMemory *mem = (GstDmaBufMemory *) gmem;
if (mem->data) {
g_mutex_clear (&mem->lock);
g_slice_free (GstDmaBufMemory, mem);
GST_DEBUG ("%p: freed", mem);
+#endif
}
static gpointer
static void
gst_dmabuf_mem_unmap (GstMemory * gmem)
{
-#if HAVE_MMAP
+#ifdef HAVE_MMAP
GstDmaBufMemory *mem = (GstDmaBufMemory *) gmem;
g_mutex_lock (&mem->lock);
static GstMemory *
gst_dmabuf_mem_share (GstMemory * gmem, gssize offset, gssize size)
{
+#ifdef HAVE_MMAP
GstDmaBufMemory *mem = (GstDmaBufMemory *) gmem;
GstDmaBufMemory *sub;
GstMemory *parent;
g_mutex_init (&sub->lock);
return GST_MEMORY_CAST (sub);
+#else /* !HAVE_MMAP */
+ return NULL;
+#endif
}
typedef struct
GstMemory *
gst_dmabuf_allocator_alloc (GstAllocator * allocator, gint fd, gsize size)
{
+#ifdef HAVE_MMAP
GstDmaBufMemory *mem;
if (!GST_IS_DMABUF_ALLOCATOR (allocator)) {
mem->mem.maxsize);
return (GstMemory *) mem;
+#else /* !HAVE_MMAP */
+ return NULL;
+#endif
}
/**