From: Gilbok Lee Date: Tue, 15 Dec 2020 08:46:18 +0000 (+0900) Subject: h264parse: ignore GST_H264_PARSER_NO_NAL return when last nal type is GST_H264_NAL_SE... X-Git-Tag: submit/tizen/20201224.044957^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b65090e6b962c0bf88c15488f63bb7f2708000b7;p=platform%2Fupstream%2Fgst-plugins-bad.git h264parse: ignore GST_H264_PARSER_NO_NAL return when last nal type is GST_H264_NAL_SEQ_END Change-Id: Ie3c42c98ff22079bd1da31c96e8f26d04d035b6d --- diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 2601fc611..a0348ba45 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -1185,6 +1185,9 @@ gst_h264_parse_handle_frame (GstBaseParse * parse, gint framesize; GstFlowReturn ret; gboolean au_complete; +#ifdef TIZEN_FEATURE_H264PARSE_MODIFICATION + GstH264NalUnitType last_nal_type = GST_H264_NAL_UNKNOWN; +#endif if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (frame->buffer, GST_BUFFER_FLAG_DISCONT))) { @@ -1278,6 +1281,9 @@ gst_h264_parse_handle_frame (GstBaseParse * parse, case GST_H264_PARSER_OK: GST_DEBUG_OBJECT (h264parse, "complete nal (offset, size): (%u, %u) ", nalu.offset, nalu.size); +#ifdef TIZEN_FEATURE_H264PARSE_MODIFICATION + last_nal_type = nalu.type; +#endif break; case GST_H264_PARSER_NO_NAL_END: GST_DEBUG_OBJECT (h264parse, "not a complete nal found at offset %u", @@ -1306,6 +1312,15 @@ gst_h264_parse_handle_frame (GstBaseParse * parse, ("Error parsing H.264 stream"), ("Invalid H.264 stream")); goto invalid_stream; case GST_H264_PARSER_NO_NAL: +#ifdef TIZEN_FEATURE_H264PARSE_MODIFICATION + if (last_nal_type == GST_H264_NAL_SEQ_END) { + GST_WARNING_OBJECT (h264parse, "No H.264 NAL unit found, but last " + "nal type is SEQ_END, So push remain buffer"); + gst_buffer_unmap (buffer, &map); + gst_h264_parse_parse_frame (parse, frame); + return gst_base_parse_finish_frame (parse, frame, size); + } +#endif GST_ELEMENT_ERROR (h264parse, STREAM, FORMAT, ("Error parsing H.264 stream"), ("No H.264 NAL unit found")); goto invalid_stream; diff --git a/packaging/gst-plugins-bad.spec b/packaging/gst-plugins-bad.spec index ce88768ae..8b4da0b84 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: 4 +Release: 5 Summary: GStreamer Streaming-Media Framework Plug-Ins License: LGPL-2.0+ Group: Multimedia/Framework @@ -84,6 +84,7 @@ export CFLAGS+=" -Wall -g -fPIC\ -DTIZEN_FEATURE_TSDEMUX_MODIFICATION\ -DTIZEN_FEATURE_OALSINK_MODIFICATION\ -DTIZEN_FEATURE_MPEGDEMUX_MODIFICATION\ + -DTIZEN_FEATURE_H264PARSE_MODIFICATION\ -DTIZEN_FEATURE_UPSTREAM\ -fstack-protector-strong\ -Wl,-z,relro\