h264parse,h265parse: Push parameter set NAL units again per segment-done

Some decoder implementations might drain out internal buffers and
reset its status on segment-done event. So, in case that
upstream stream-format is packetized but downstream supports only
byte-format, required codec-data might not be forwarded toward
downstream if such parameter set NAL units don't exist in inband
bitstream. Therefore, parse elements should re-send parameter set NAL
units like the case of flush event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2334>
This commit is contained in:
Seungha Yang 2021-06-17 01:00:33 +09:00 committed by GStreamer Marge Bot
parent 2696bcd9e2
commit 058957fc22
2 changed files with 2 additions and 0 deletions

View file

@ -3678,6 +3678,7 @@ gst_h264_parse_event (GstBaseParse * parse, GstEvent * event)
break; break;
} }
case GST_EVENT_FLUSH_STOP: case GST_EVENT_FLUSH_STOP:
case GST_EVENT_SEGMENT_DONE:
h264parse->dts = GST_CLOCK_TIME_NONE; h264parse->dts = GST_CLOCK_TIME_NONE;
h264parse->ts_trn_nb = GST_CLOCK_TIME_NONE; h264parse->ts_trn_nb = GST_CLOCK_TIME_NONE;
h264parse->push_codec = TRUE; h264parse->push_codec = TRUE;

View file

@ -3183,6 +3183,7 @@ gst_h265_parse_event (GstBaseParse * parse, GstEvent * event)
break; break;
} }
case GST_EVENT_FLUSH_STOP: case GST_EVENT_FLUSH_STOP:
case GST_EVENT_SEGMENT_DONE:
h265parse->push_codec = TRUE; h265parse->push_codec = TRUE;
res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event); res = GST_BASE_PARSE_CLASS (parent_class)->sink_event (parse, event);
break; break;