h264parse: ignore GST_H264_PARSER_NO_NAL return when last nal type is GST_H264_NAL_SE...
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 15 Dec 2020 08:46:18 +0000 (17:46 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 16 Dec 2020 08:28:21 +0000 (17:28 +0900)
Change-Id: Ie3c42c98ff22079bd1da31c96e8f26d04d035b6d

gst/videoparsers/gsth264parse.c
packaging/gst-plugins-bad.spec

index 2601fc6..a0348ba 100644 (file)
@@ -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;
index ce88768..8b4da0b 100644 (file)
@@ -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\