good:v4l2bufferpool: Add video meta for GstV4l2TizenBuffer 27/308527/1
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 27 Mar 2024 05:37:08 +0000 (14:37 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 27 Mar 2024 05:38:07 +0000 (14:38 +0900)
[Version] 1.22.8-6
[Issue Type] Update

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

index fe3b1fa67e39778127ff7abaffb37ca29b5b3d7b..22093a1d176df14a692978ae94f82545195915d3 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.22.8
-Release:        5
+Release:        6
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index e62b91c14097d57f398e0a5c3510d714311fae3e..809ae57d351a6a1267bcda0c71111a6477d8248a 100644 (file)
@@ -135,8 +135,17 @@ static GstV4l2TizenBuffer *
 gst_v4l2_tizen_buffer_new (GstBuffer *v4l2_buffer, int index, GstV4l2BufferPool *v4l2_pool)
 {
   GstV4l2TizenBuffer *tizen_buffer = NULL;
+  GstVideoInfo *info = NULL;
+  GstVideoMeta *videometa = NULL;
   GstMemory *memory = NULL;
 
+  if (!v4l2_pool || !v4l2_pool->obj) {
+    GST_ERROR_OBJECT (v4l2_pool, "NULL V4L2 pool[%p] or obj", v4l2_pool);
+    return NULL;
+  }
+
+  info = &v4l2_pool->obj->info;
+
   tizen_buffer = g_new0 (GstV4l2TizenBuffer, 1);
   tizen_buffer->index = index;
   tizen_buffer->v4l2_buffer = v4l2_buffer;
@@ -144,12 +153,23 @@ gst_v4l2_tizen_buffer_new (GstBuffer *v4l2_buffer, int index, GstV4l2BufferPool
   tizen_buffer->v4l2_pool = gst_object_ref (v4l2_pool);
 
   memory = gst_tizen_allocator_alloc_surface (v4l2_pool->tallocator,
-      &v4l2_pool->obj->info, v4l2_pool->vallocator->groups[index]->surface, (gpointer)tizen_buffer,
+      info, v4l2_pool->vallocator->groups[index]->surface, (gpointer)tizen_buffer,
       (GDestroyNotify)gst_v4l2_tizen_buffer_finalize);
 
   gst_buffer_append_memory (tizen_buffer->gst_buffer, memory);
   gst_buffer_set_size (tizen_buffer->gst_buffer, v4l2_pool->vallocator->s_info.size);
 
+  videometa = gst_buffer_add_video_meta_full (tizen_buffer->gst_buffer, GST_VIDEO_FRAME_FLAG_NONE,
+    GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
+    GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info),
+    info->offset, info->stride);
+  if (videometa) {
+    videometa->map = gst_tizen_video_meta_map;
+    videometa->unmap = gst_tizen_video_meta_unmap;
+  } else {
+    GST_WARNING_OBJECT (v4l2_pool, "videometa failed");
+  }
+
   g_mutex_lock (&v4l2_pool->buffer_lock);
 
   v4l2_pool->live_buffer_count++;