[v4l2] Change feature name
[platform/upstream/gst-plugins-good.git] / sys / v4l2 / gstv4l2allocator.c
index a06c822..421ddf6 100644 (file)
 #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"
 
@@ -239,13 +239,13 @@ gst_v4l2_memory_group_free (GstV4l2MemoryGroup * group)
     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);
 }
@@ -439,13 +439,13 @@ gst_v4l2_allocator_finalize (GObject * obj)
   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);
@@ -638,7 +638,7 @@ _cleanup_failed_alloc (GstV4l2Allocator * allocator, GstV4l2MemoryGroup * group)
   }
 }
 
-#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) {
@@ -651,7 +651,7 @@ static tbm_format __get_tbm_format (GstVideoFormat 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)
@@ -691,7 +691,7 @@ 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) {
@@ -717,7 +717,7 @@ gst_v4l2_allocator_new (GstObject * parent, GstV4l2Object * v4l2object)
       return NULL;
     }
   }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   return allocator;
 }
 
@@ -941,9 +941,9 @@ gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * 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);
 
@@ -974,13 +974,13 @@ gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * allocator,
           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);
@@ -1002,7 +1002,7 @@ gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * 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);
@@ -1010,7 +1010,7 @@ gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * allocator,
   /* 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);