From: Jeongmo Yang Date: Wed, 27 Mar 2024 05:37:08 +0000 (+0900) Subject: good:v4l2bufferpool: Add video meta for GstV4l2TizenBuffer X-Git-Tag: accepted/tizen/unified/20240328.123412~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F308527%2F1;p=platform%2Fupstream%2Fgstreamer.git good:v4l2bufferpool: Add video meta for GstV4l2TizenBuffer [Version] 1.22.8-6 [Issue Type] Update Change-Id: Ifa2f85a002f7c9616580bdac78039b6733e69187 Signed-off-by: Jeongmo Yang --- diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index fe3b1fa67e..22093a1d17 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -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 diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c index e62b91c140..809ae57d35 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c @@ -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++;