From 6143fc2e56840282b44a63e5b1a12d5d8768e721 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Fri, 29 Mar 2024 12:07:06 +0900 Subject: [PATCH] libav:avviddec: Add videometa if there is no videometa in output buffer - The buffer from internal pool in avviddec has video meta, but, the output buffer is not from internal pool in avviddec and it's from other buffer pool which is made in gst_video_decoder_decide_allocation_default(). As a result, the output buffer does not have video meta. [Version] 1.22.8-7 [Issue Type] Improvement Change-Id: I678ec172fdd92eddfe1a281f23d81f4106489f15 Signed-off-by: Jeongmo Yang --- packaging/gstreamer.spec | 2 +- subprojects/gst-libav/ext/libav/gstavviddec.c | 15 +++++++++++++++ subprojects/gst-libav/meson.build | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 22093a1d17..1994aa5273 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -62,7 +62,7 @@ Name: %{_name} Version: 1.22.8 -Release: 6 +Release: 7 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-libav/ext/libav/gstavviddec.c b/subprojects/gst-libav/ext/libav/gstavviddec.c index fff15893b2..0e8a6a8f1e 100644 --- a/subprojects/gst-libav/ext/libav/gstavviddec.c +++ b/subprojects/gst-libav/ext/libav/gstavviddec.c @@ -1980,6 +1980,21 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, GST_BUFFER_FLAG_SET (out_frame->output_buffer, GST_VIDEO_BUFFER_FLAG_TFF); } } +#ifdef TIZEN_FEATURE_LIBAV_VIDEODECODER_ADD_VIDEOMETA + { + GstVideoMeta *vmeta = gst_buffer_get_video_meta (out_frame->output_buffer); + if (!vmeta) { + GstVideoInfo *out_info = &ffmpegdec->output_state->info; + + GST_DEBUG_OBJECT (ffmpegdec, "add videometa for output buffer"); + + gst_buffer_add_video_meta_full (out_frame->output_buffer, GST_VIDEO_FRAME_FLAG_NONE, + GST_VIDEO_INFO_FORMAT (out_info), + GST_VIDEO_INFO_WIDTH (out_info), GST_VIDEO_INFO_HEIGHT (out_info), + GST_VIDEO_INFO_N_PLANES (out_info), out_info->offset, out_info->stride); + } + } +#endif /* TIZEN_FEATURE_LIBAV_VIDEODECODER_ADD_VIDEOMETA */ *ret = gst_video_decoder_finish_frame (GST_VIDEO_DECODER (ffmpegdec), out_frame); diff --git a/subprojects/gst-libav/meson.build b/subprojects/gst-libav/meson.build index 6c33d00a6a..e8fc6f6060 100644 --- a/subprojects/gst-libav/meson.build +++ b/subprojects/gst-libav/meson.build @@ -190,6 +190,7 @@ if get_option('tv-profile') cdata.set ('TIZEN_PRODUCT_TV', true) endif cdata.set ('TIZEN_FEATURE_LIBAV', true) +cdata.set ('TIZEN_FEATURE_LIBAV_VIDEODECODER_ADD_VIDEOMETA', true) warning_flags = [ '-Wmissing-declarations', -- 2.34.1