[v4l2] Change feature name 97/253597/1
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 16 Feb 2021 02:44:23 +0000 (11:44 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 16 Feb 2021 02:49:28 +0000 (11:49 +0900)
As-is: TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
To-be: TIZEN_FEATURE_V4L2_TBM_SUPPORT

The TBM feature could be used in other V4L2 related plugins.

[Version] 1.16.2-20
[Issue Type] Update

Change-Id: Id013ee0657dd408a895b8e049ce61260b4e99fcf
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/gst-plugins-good.spec
sys/v4l2/gstv4l2.c
sys/v4l2/gstv4l2allocator.c
sys/v4l2/gstv4l2allocator.h
sys/v4l2/gstv4l2bufferpool.c
sys/v4l2/gstv4l2bufferpool.h
sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2object.h
sys/v4l2/gstv4l2videodec.c

index cc505f5..49236fa 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:           gst-plugins-good
 Version:        1.16.2
-Release:        19
+Release:        20
 License:        LGPL-2.1+
 Summary:        GStreamer Streaming-Media Framework Plug-Ins
 Url:            http://gstreamer.freedesktop.org/
@@ -91,7 +91,7 @@ export CFLAGS+=" \
        -DTIZEN_FEATURE_AVIDEMUX_MODIFICATION\
        -DTIZEN_FEATURE_USE_LIBV4L2\
        -DTIZEN_FEATURE_V4L2_ADDITIONAL_CID_SUPPORT\
-       -DTIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER\
+       -DTIZEN_FEATURE_V4L2_TBM_SUPPORT\
        -fstack-protector-strong\
        -Wl,-z,relro\
        -D_FORTIFY_SOURCE=2"
index 8a9ea97..599d9f3 100644 (file)
@@ -99,7 +99,7 @@ gst_v4l2_probe_template_caps (const gchar * device, gint video_fd,
       GstStructure *alt_t = NULL;
 
       switch (format.pixelformat) {
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
         case V4L2_PIX_FMT_YUV420:
           alt_t = gst_structure_copy (template);
           gst_structure_set (alt_t, "format", G_TYPE_STRING, "S420", NULL);
@@ -108,7 +108,7 @@ gst_v4l2_probe_template_caps (const gchar * device, gint video_fd,
           alt_t = gst_structure_copy (template);
           gst_structure_set (alt_t, "format", G_TYPE_STRING, "SN12", NULL);
           break;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
         case V4L2_PIX_FMT_RGB32:
           alt_t = gst_structure_copy (template);
           gst_structure_set (alt_t, "format", G_TYPE_STRING, "ARGB", NULL);
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);
 
index 7e959f0..25ec2d5 100644 (file)
 #include "ext/videodev2.h"
 #include <gst/gst.h>
 #include <gst/gstatomicqueue.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 */
 
 G_BEGIN_DECLS
 
@@ -94,9 +94,9 @@ struct _GstV4l2MemoryGroup
   gint mems_allocated;
   struct v4l2_buffer buffer;
   struct v4l2_plane planes[VIDEO_MAX_PLANES];
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   tbm_surface_h surface;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 };
 
 struct _GstV4l2Allocator
@@ -111,11 +111,11 @@ struct _GstV4l2Allocator
   GstV4l2MemoryGroup * groups[VIDEO_MAX_FRAME];
   GstAtomicQueue *free_queue;
   GstAtomicQueue *pending_queue;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   tbm_bufmgr bufmgr;
   tbm_surface_info_s s_info;
   gint live_buffer_count;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 };
 
 struct _GstV4l2AllocatorClass {
index dce6daa..4d94937 100644 (file)
@@ -45,9 +45,9 @@
 #include "gstv4l2object.h"
 #include "gst/gst-i18n-plugin.h"
 #include <gst/glib-compat-private.h>
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
 #include <gst/allocators/gsttizenmemory.h>
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
 GST_DEBUG_CATEGORY_STATIC (v4l2bufferpool_debug);
 GST_DEBUG_CATEGORY_STATIC (CAT_PERFORMANCE);
@@ -70,7 +70,7 @@ enum _GstV4l2BufferPoolAcquireFlags
 
 static void gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool,
     GstBuffer * buffer);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
 typedef struct _GstV4l2TizenBuffer GstV4l2TizenBuffer;
 struct _GstV4l2TizenBuffer {
   int index;
@@ -137,7 +137,7 @@ static GstV4l2TizenBuffer *gst_v4l2_tizen_buffer_new (GstBuffer *v4l2_buffer, in
 
   return tizen_buffer;
 }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
 static gboolean
 gst_v4l2_is_buffer_valid (GstBuffer * buffer, GstV4l2MemoryGroup ** out_group)
@@ -763,14 +763,14 @@ gst_v4l2_buffer_pool_streamoff (GstV4l2BufferPool * pool)
   GstBufferPoolClass *pclass = GST_BUFFER_POOL_CLASS (parent_class);
   GstV4l2Object *obj = pool->obj;
   gint i;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   gint64 end_time = 0;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   if (!pool->streaming)
     return;
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   if (obj->tbm_output && !V4L2_TYPE_IS_OUTPUT(pool->obj->type)) {
     g_mutex_lock (&pool->buffer_lock);
 
@@ -794,7 +794,7 @@ gst_v4l2_buffer_pool_streamoff (GstV4l2BufferPool * pool)
 
     g_mutex_unlock (&pool->buffer_lock);
   }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   switch (obj->mode) {
     case GST_V4L2_IO_MMAP:
     case GST_V4L2_IO_USERPTR:
@@ -1318,9 +1318,9 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer,
   GstVideoMeta *vmeta;
   gsize size;
   gint i;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   GstV4l2TizenBuffer *tizen_buffer = NULL;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   if ((res = gst_v4l2_buffer_pool_poll (pool, wait)) < GST_FLOW_OK)
     goto poll_failed;
@@ -1453,7 +1453,7 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer,
   GST_BUFFER_OFFSET (outbuf) = group->buffer.sequence;
   GST_BUFFER_OFFSET_END (outbuf) = group->buffer.sequence + 1;
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   if (group->surface) {
     tizen_buffer = gst_v4l2_tizen_buffer_new (outbuf, group->buffer.index, pool);
     if (!tizen_buffer) {
@@ -1462,7 +1462,7 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer,
     }
     outbuf = tizen_buffer->gst_buffer;
   }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 done:
   *buffer = outbuf;
 
@@ -1701,14 +1701,14 @@ gst_v4l2_buffer_pool_dispose (GObject * object)
     gst_object_unref (pool->allocator);
   pool->allocator = NULL;
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   g_cond_clear (&pool->buffer_cond);
   g_mutex_clear (&pool->buffer_lock);
 
   if (pool->tallocator)
     gst_object_unref (pool->tallocator);
   pool->tallocator = NULL;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   if (pool->other_pool)
     gst_object_unref (pool->other_pool);
   pool->other_pool = NULL;
@@ -1814,14 +1814,14 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
   pool->obj = obj;
   pool->can_poll_device = TRUE;
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   pool->tallocator = gst_tizen_allocator_new ();
   if (pool->tallocator == NULL)
     goto allocator_failed;
 
   g_mutex_init (&pool->buffer_lock);
   g_cond_init (&pool->buffer_cond);
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   pool->vallocator = gst_v4l2_allocator_new (GST_OBJECT (pool), obj);
   if (pool->vallocator == NULL)
     goto allocator_failed;
@@ -1844,12 +1844,12 @@ dup_failed:
   }
 allocator_failed:
   {
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
     if (pool->tallocator) {
       gst_object_unref (pool->tallocator);
       pool->tallocator = NULL;
     }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
     GST_ERROR_OBJECT (pool, "Failed to create V4L2 allocator");
     gst_object_unref (pool);
     return NULL;
@@ -2019,19 +2019,19 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer ** buf)
             if (GST_V4L2_IS_M2M (obj->device_caps))
               goto eos;
           }
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
           if (pool->obj->tbm_output && pool->obj->mode == GST_V4L2_IO_DMABUF) {
             gst_buffer_unref (*buf);
             *buf = tmp;
           } else {
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
           ret = gst_v4l2_buffer_pool_copy_buffer (pool, *buf, tmp);
 
           /* an queue the buffer again after the copy */
           gst_v4l2_buffer_pool_release_buffer (bpool, tmp);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
           }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
           if (ret != GST_FLOW_OK)
             goto copy_failed;
index 62703ab..f076267 100644 (file)
@@ -68,12 +68,12 @@ struct _GstV4l2BufferPool
 
   GstV4l2Allocator *vallocator;
   GstAllocator *allocator;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   GstAllocator *tallocator;
   gint live_buffer_count;
   GMutex buffer_lock;
   GCond buffer_cond;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   GstAllocationParams params;
   GstBufferPool *other_pool;
   guint size;
index 8cc1b93..a8f68da 100644 (file)
@@ -829,7 +829,7 @@ gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
   if (v4l2object->ioctl (v4l2object->video_fd, VIDIOC_G_CTRL, &control) == 0) {
     GST_DEBUG_OBJECT (v4l2object->dbg_obj,
         "driver requires a minimum of %d buffers", control.value);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
 #define DEFAULT_DECODER_OUTPUT_BUFFER_COUNT 5
     if (v4l2object->tbm_output &&
         !V4L2_TYPE_IS_OUTPUT (v4l2object->type) && control.value == 1) {
@@ -839,9 +839,9 @@ gst_v4l2_get_driver_min_buffers (GstV4l2Object * v4l2object)
     } else {
       v4l2object->min_buffers = control.value;
     }
-#else /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#else /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
     v4l2object->min_buffers = control.value;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   } else {
     v4l2object->min_buffers = 0;
   }
@@ -1639,7 +1639,7 @@ gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
       }
 
       switch (gst_v4l2_formats[i].format) {
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
         case V4L2_PIX_FMT_YUV420:
           alt_s = gst_structure_copy (structure);
           gst_structure_set (alt_s, "format", G_TYPE_STRING, "S420", NULL);
@@ -1648,7 +1648,7 @@ gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
           alt_s = gst_structure_copy (structure);
           gst_structure_set (alt_s, "format", G_TYPE_STRING, "SN12", NULL);
           break;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
         case V4L2_PIX_FMT_RGB32:
           alt_s = gst_structure_copy (structure);
           gst_structure_set (alt_s, "format", G_TYPE_STRING, "ARGB", NULL);
@@ -1738,9 +1738,9 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
   if (g_str_equal (mimetype, "video/x-raw")) {
     switch (GST_VIDEO_INFO_FORMAT (info)) {
       case GST_VIDEO_FORMAT_I420:
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
       case GST_VIDEO_FORMAT_S420:
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
         fourcc = V4L2_PIX_FMT_YUV420;
         fourcc_nc = V4L2_PIX_FMT_YUV420M;
         break;
@@ -1760,9 +1760,9 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
         fourcc = V4L2_PIX_FMT_YUV422P;
         break;
       case GST_VIDEO_FORMAT_NV12:
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
       case GST_VIDEO_FORMAT_SN12:
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
         fourcc = V4L2_PIX_FMT_NV12;
         fourcc_nc = V4L2_PIX_FMT_NV12M;
         break;
@@ -4287,7 +4287,7 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter)
     if (tmp)
       gst_caps_append (ret, tmp);
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
     if (format->pixelformat == V4L2_PIX_FMT_NV12 ||
         format->pixelformat == V4L2_PIX_FMT_YUV420) {
       GstStructure *alt_s = gst_structure_copy (template);
@@ -4305,7 +4305,7 @@ gst_v4l2_object_probe_caps (GstV4l2Object * v4l2object, GstCaps * filter)
 
       gst_structure_free (alt_s);
     }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
     gst_structure_free (template);
   }
 
@@ -4353,12 +4353,12 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
   GstAllocator *allocator = NULL;
   GstAllocationParams params = { 0 };
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   GST_INFO_OBJECT (obj->dbg_obj, "decide allocation - %s",
       V4L2_TYPE_IS_OUTPUT (obj->type) ? "output" : "capture");
-#else /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#else /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   GST_DEBUG_OBJECT (obj->dbg_obj, "decide allocation");
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   g_return_val_if_fail (obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE ||
       obj->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, FALSE);
index 6393349..6e6258d 100644 (file)
@@ -131,9 +131,9 @@ struct _GstV4l2Object {
   /* auto scan device */
   gboolean auto_scan_device;
 #endif /* TIZEN_FEATURE_V4L2SRC_AUTO_SCAN_DEVICE_NODE */
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   gboolean tbm_output;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   /* the video-device's file descriptor */
   gint video_fd;
index f1c32e8..0fbd7f6 100644 (file)
@@ -51,9 +51,9 @@ enum
 {
   PROP_0,
   V4L2_STD_OBJECT_PROPS
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   , PROP_TBM_OUTPUT
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 };
 
 #define gst_v4l2_video_dec_parent_class parent_class
@@ -62,7 +62,7 @@ G_DEFINE_ABSTRACT_TYPE (GstV4l2VideoDec, gst_v4l2_video_dec,
 
 static GstFlowReturn gst_v4l2_video_dec_finish (GstVideoDecoder * decoder);
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
 static void gst_v4l2_video_dec_flush_buffer_event (GstVideoDecoder * decoder)
 {
   gboolean ret = FALSE;
@@ -78,7 +78,7 @@ static void gst_v4l2_video_dec_flush_buffer_event (GstVideoDecoder * decoder)
 
   GST_WARNING_OBJECT(decoder, "event push ret[%d] for flush-buffer", ret);
 }
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 static void
 gst_v4l2_video_dec_set_property (GObject * object,
     guint prop_id, const GValue * value, GParamSpec * pspec)
@@ -92,12 +92,12 @@ gst_v4l2_video_dec_set_property (GObject * object,
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       }
       break;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
     case PROP_TBM_OUTPUT:
       self->v4l2capture->tbm_output = g_value_get_boolean (value);
       GST_INFO_OBJECT (self, "tbm output [%d]", self->v4l2capture->tbm_output);
       break;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
 
       /* By default, only set on output */
@@ -123,12 +123,12 @@ gst_v4l2_video_dec_get_property (GObject * object,
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       }
       break;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
     case PROP_TBM_OUTPUT:
       GST_INFO_OBJECT (self, "tbm output [%d]", self->v4l2capture->tbm_output);
       g_value_set_boolean (value, self->v4l2capture->tbm_output);
       break;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
       /* By default read from output */
     default:
@@ -231,9 +231,9 @@ gst_v4l2_video_dec_stop (GstVideoDecoder * decoder)
 
   /* Should have been flushed already */
   g_assert (g_atomic_int_get (&self->active) == FALSE);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   gst_v4l2_video_dec_flush_buffer_event (decoder);
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   gst_v4l2_object_stop (self->v4l2output);
   gst_v4l2_object_stop (self->v4l2capture);
@@ -347,9 +347,9 @@ gst_v4l2_video_dec_flush (GstVideoDecoder * decoder)
   if (self->v4l2output->pool)
     gst_v4l2_buffer_pool_flush (self->v4l2output->pool);
 
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   gst_v4l2_video_dec_flush_buffer_event (decoder);
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   /* gst_v4l2_buffer_pool_flush() calls streamon the capture pool and must be
    * called after gst_v4l2_object_unlock_stop() stopped flushing the buffer
    * pool. */
@@ -609,12 +609,12 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
   gboolean processed = FALSE;
   GstBuffer *tmp;
   GstTaskState task_state;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   GstStructure *structure = NULL;
   const gchar *caps_format = NULL;
   GstMessage *msg = NULL;
   GstV4l2BufferPool *capture_pool = NULL;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
   GST_DEBUG_OBJECT (self, "Handling frame %d", frame->system_frame_number);
 
@@ -714,7 +714,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
     caps = gst_caps_fixate (caps);
 
     GST_DEBUG_OBJECT (self, "Chosen decoded caps: %" GST_PTR_FORMAT, caps);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
     structure = gst_caps_get_structure (caps, 0);
     caps_format = gst_structure_get_string (structure, "format");
 
@@ -726,7 +726,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
       gst_caps_set_simple (caps, "format", G_TYPE_STRING, "SN12", NULL);
     }
     GST_INFO_OBJECT (self, "Updated decoded caps: %" GST_PTR_FORMAT, caps);
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 
     /* Try to set negotiated format, on success replace acquired format */
     if (gst_v4l2_object_set_format (self->v4l2capture, caps, &error))
@@ -753,7 +753,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
     if (!gst_buffer_pool_set_active (GST_BUFFER_POOL (self->v4l2capture->pool),
             TRUE))
       goto activate_failed;
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
     capture_pool = GST_V4L2_BUFFER_POOL (self->v4l2capture->pool);
 
     msg = gst_message_new_element (GST_OBJECT_CAST (decoder),
@@ -764,7 +764,7 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
     gst_element_post_message (GST_ELEMENT_CAST (decoder), msg);
 
     GST_WARNING_OBJECT (self, "output buffer[%d]", capture_pool->num_allocated);
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
   }
 
   task_state = gst_pad_get_task_state (GST_VIDEO_DECODER_SRC_PAD (self));
@@ -1035,9 +1035,9 @@ gst_v4l2_video_dec_subinstance_init (GTypeInstance * instance, gpointer g_class)
       GST_OBJECT (GST_VIDEO_DECODER_SRC_PAD (self)),
       V4L2_BUF_TYPE_VIDEO_CAPTURE, klass->default_device,
       gst_v4l2_get_input, gst_v4l2_set_input, NULL);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   self->v4l2capture->tbm_output = TRUE;
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 }
 
 static void
@@ -1090,12 +1090,12 @@ gst_v4l2_video_dec_class_init (GstV4l2VideoDecClass * klass)
       GST_DEBUG_FUNCPTR (gst_v4l2_video_dec_change_state);
 
   gst_v4l2_object_install_m2m_properties_helper (gobject_class);
-#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+#ifdef TIZEN_FEATURE_V4L2_TBM_SUPPORT
   g_object_class_install_property (gobject_class, PROP_TBM_OUTPUT,
       g_param_spec_boolean ("tbm-output", "Enable TBM for output buffer",
           "It works for only DMABUF mode.",
           TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */
+#endif /* TIZEN_FEATURE_V4L2_TBM_SUPPORT */
 }
 
 static void