#include <sys/mman.h>
#include <unistd.h>
#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+#include <gst/allocators/gsttizenmemory.h>
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
gint dmafd;
gsize size, offset, maxsize;
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+ if (!gst_is_tizen_memory (dma_mem[i]) && !gst_is_dmabuf_memory (dma_mem[i]))
+#else
if (!gst_is_dmabuf_memory (dma_mem[i]))
+#endif
goto not_dmabuf;
size = gst_memory_get_sizes (dma_mem[i], &offset, &maxsize);
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
+ if (gst_is_tizen_memory (dma_mem[i]))
+ dmafd = gst_tizen_memory_get_fd (dma_mem[i], 0);
+ else
+#endif
dmafd = gst_dmabuf_memory_get_fd (dma_mem[i]);
GST_LOG_OBJECT (allocator, "[%i] imported DMABUF as fd %i plane %d",