From: Eunhye Choi Date: Wed, 14 Jul 2021 10:00:24 +0000 (+0900) Subject: videoparse: Only add a single closed caption meta X-Git-Tag: accepted/tizen/unified/20220217.153506~2^2~10^2~9^2~12^2~2^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=626b8133b89be931102ebe656a6f107ba02db9af;p=platform%2Fupstream%2Fgstreamer.git videoparse: Only add a single closed caption meta Only add a single closed caption meta Otherwise, having a stream go through a parser multiple times would result in duplicate closed caption meta. Part-of: upstream commit id : 31d5d04bb1f5e3f6acdef8460193019237ecf5df Change-Id: I587de0415e78e9e0de21ef079e594bec9bfedabd --- diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index a0348ba..3b74949 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -2598,9 +2598,20 @@ gst_h264_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) } if (h264parse->closedcaptions_size > 0) { +#ifdef TIZEN_FEATURE_UPSTREAM + if (!gst_buffer_get_meta (buffer, GST_VIDEO_CAPTION_META_API_TYPE)) { + gst_buffer_add_video_caption_meta (buffer, + h264parse->closedcaptions_type, h264parse->closedcaptions, + h264parse->closedcaptions_size); + } else { + GST_DEBUG_OBJECT (h264parse, "Closed caption data already found on buffer, " + "discarding to avoid duplication"); + } +#else gst_buffer_add_video_caption_meta (buffer, h264parse->closedcaptions_type, h264parse->closedcaptions, h264parse->closedcaptions_size); +#endif h264parse->closedcaptions_type = GST_VIDEO_CAPTION_TYPE_UNKNOWN; h264parse->closedcaptions_size = 0; diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c index eef79bc..c61ea70 100644 --- a/gst/videoparsers/gstmpegvideoparse.c +++ b/gst/videoparsers/gstmpegvideoparse.c @@ -1113,9 +1113,20 @@ gst_mpegv_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) buf = frame->buffer = gst_buffer_make_writable (frame->buffer); } +#ifdef TIZEN_FEATURE_UPSTREAM + if (!gst_buffer_get_meta (buf, GST_VIDEO_CAPTION_META_API_TYPE)) { + gst_buffer_add_video_caption_meta (buf, + mpvparse->closedcaptions_type, mpvparse->closedcaptions, + mpvparse->closedcaptions_size); + } else { + GST_DEBUG_OBJECT (mpvparse, "Closed caption data already found on buffer, " + "discarding to avoid duplication"); + } +#else gst_buffer_add_video_caption_meta (buf, mpvparse->closedcaptions_type, mpvparse->closedcaptions, mpvparse->closedcaptions_size); +#endif mpvparse->closedcaptions_type = GST_VIDEO_CAPTION_TYPE_UNKNOWN; mpvparse->closedcaptions_size = 0; diff --git a/packaging/gst-plugins-bad.spec b/packaging/gst-plugins-bad.spec index 50b891f..2e1e716 100644 --- a/packaging/gst-plugins-bad.spec +++ b/packaging/gst-plugins-bad.spec @@ -4,7 +4,7 @@ Name: gst-plugins-bad Version: 1.16.2 -Release: 20 +Release: 21 Summary: GStreamer Streaming-Media Framework Plug-Ins License: LGPL-2.0+ Group: Multimedia/Framework