libav:avviddec: Add videometa if there is no videometa in output buffer 19/308819/1 accepted/tizen/8.0/unified/20240404.155006
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 29 Mar 2024 03:07:06 +0000 (12:07 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 1 Apr 2024 11:15:34 +0000 (20:15 +0900)
- 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.0-38
[Issue Type] Improvement

Change-Id: I678ec172fdd92eddfe1a281f23d81f4106489f15
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/gstreamer.spec
subprojects/gst-libav/ext/libav/gstavviddec.c
subprojects/gst-libav/meson.build

index 1da1610c986adfaf88edaa3b5d9994be7897fea7..a1180e984136d0b16681f9bb9e6935e3b71e6ee5 100644 (file)
@@ -62,7 +62,7 @@
 
 Name:           %{_name}
 Version:        1.22.0
-Release:        37
+Release:        38
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index 43cea456ae88dda0243a00029354c8de96f281c9..394a821f7e2d79eac746e77eda9c04afaf0d504a 100644 (file)
@@ -1970,6 +1970,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);
 
index 4ac35b1229f086cee8e226d1b6ad450276db7f7b..c10227216de2820489d56c41ed1a59c2ee376ac3 100644 (file)
@@ -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',