v4l2h264enc: Support tizen memory for input buffer 61/285161/3
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 7 Dec 2022 05:01:36 +0000 (14:01 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 7 Dec 2022 13:24:15 +0000 (05:24 -0800)
[Version] 1.20.0-42
[Issue Type] New feature

Change-Id: I50ef41c8c4fa82b08fc115ba4a0c810402d398e4
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/gstreamer.spec
subprojects/gst-plugins-good/sys/v4l2/gstv4l2allocator.c

index cc47063..bb72307 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.20.0
-Release:        41
+Release:        42
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index 07b3709..81cdb00 100644 (file)
@@ -39,6 +39,7 @@
 #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 */
@@ -1184,11 +1185,20 @@ gst_v4l2_allocator_import_dmabuf (GstV4l2Allocator * allocator,
     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",