#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
#include <tbm_surface.h>
#include <tbm_surface_internal.h>
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
#define GST_V4L2_MEMORY_TYPE "V4l2Memory"
if (mem)
gst_memory_unref (mem);
}
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
if (group->surface) {
GST_INFO ("unref surface[%p]", group->surface);
tbm_surface_destroy (group->surface);
group->surface = NULL;
}
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
g_slice_free (GstV4l2MemoryGroup, group);
}
GstV4l2Allocator *allocator = (GstV4l2Allocator *) obj;
GST_LOG_OBJECT (obj, "called");
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
if (allocator->bufmgr) {
GST_INFO_OBJECT (obj, "deinit tbm bufmgr %p", allocator->bufmgr);
tbm_bufmgr_deinit (allocator->bufmgr);
allocator->bufmgr = NULL;
}
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
gst_atomic_queue_unref (allocator->free_queue);
gst_object_unref (allocator->obj->element);
}
}
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
static tbm_format __get_tbm_format (GstVideoFormat gst_format)
{
switch (gst_format) {
return TBM_FORMAT_YUV420;
}
}
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
GstV4l2Allocator *
gst_v4l2_allocator_new (GstObject * parent, GstV4l2Object * v4l2object)
GST_OBJECT_FLAG_SET (allocator, flags);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
if (v4l2object->tbm_output &&
!V4L2_TYPE_IS_OUTPUT (v4l2object->type) &&
v4l2object->mode == GST_V4L2_IO_DMABUF) {
return NULL;
}
}
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
return allocator;
}
GstV4l2Object *obj = allocator->obj;
GstV4l2MemoryGroup *group;
gint i;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
tbm_bo bos[VIDEO_MAX_PLANES] = {NULL, };
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
g_return_val_if_fail (allocator->memory == V4L2_MEMORY_MMAP, NULL);
NULL, group->planes[i].length, 0, group->planes[i].data_offset,
group->planes[i].length - group->planes[i].data_offset, i, NULL,
expbuf.fd, group);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
if (obj->tbm_output) {
bos[i] = tbm_bo_import_fd (allocator->bufmgr, expbuf.fd);
GST_INFO_OBJECT (allocator, "obj[%p,i:%d]: fd[%d] -> bo[%p]",
obj, expbuf.index, expbuf.fd, bos[i]);
}
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
} else {
/* Take back the allocator reference */
gst_object_ref (allocator);
group->mem[i] = dma_mem;
}
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
if (obj->tbm_output && !group->surface) {
group->surface = tbm_surface_internal_create_with_bos (&allocator->s_info, bos, group->n_mem);
GST_INFO_OBJECT (allocator, "new surface[%p] in memory group[%p]", group->surface, group);
/* release bos - they will be kept in surface. */
for (i = 0 ; i < VIDEO_MAX_PLANES && bos[i] ; i++)
tbm_bo_unref (bos[i]);
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
gst_v4l2_allocator_reset_size (allocator, group);