libav:avviddec: Add videometa if there is no videometa in output buffer 01/308701/2 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20240403.095029 accepted/tizen/unified/x/20240404.061922
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 29 Mar 2024 03:07:06 +0000 (12:07 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Fri, 29 Mar 2024 05:25:50 +0000 (14:25 +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.8-7
[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 22093a1..1994aa5 100644 (file)
@@ -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
index fff1589..0e8a6a8 100644 (file)
@@ -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);
 
index 6c33d00..e8fc6f6 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',