Revert "h264parse: correct NAL mode backlog processing"

This reverts commit b2098849dc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6562>
This commit is contained in:
Daniel Morin 2024-04-04 09:36:02 -04:00 committed by GStreamer Marge Bot
parent b3d6a14737
commit c259674ed5

View file

@ -1703,11 +1703,11 @@ gst_h264_parse_process_backlog_loop (GstH264Parse * h264parse,
static gboolean static gboolean
gst_h264_parse_process_backlog_nal (GstH264Parse * h264parse, gint * proc_size, gst_h264_parse_process_backlog_nal (GstH264Parse * h264parse, gint * proc_size,
gboolean * aud_insert, guint8 * data, gboolean drain, gboolean au_completed) gboolean * aud_insert, guint8 * data, gboolean clear_bl,
gboolean au_completed)
{ {
GstH264NalUnit *bnalu; GstH264NalUnit *bnalu;
gint framesize = 0; gint framesize = 0;
gboolean next_is_aud = FALSE;
g_assert (h264parse->nal_backlog != NULL); g_assert (h264parse->nal_backlog != NULL);
g_assert (h264parse->nal_backlog->len > 0); g_assert (h264parse->nal_backlog->len > 0);
@ -1737,19 +1737,14 @@ gst_h264_parse_process_backlog_nal (GstH264Parse * h264parse, gint * proc_size,
gst_h264_parse_trim_backlog (h264parse); gst_h264_parse_trim_backlog (h264parse);
} }
if (h264parse->bl_next_nal < h264parse->nal_backlog->len) { /* Process all backlog. Used when draining or output in NAL mode. */
bnalu = &g_array_index (h264parse->nal_backlog, GstH264NalUnit, if (!gst_h264_parse_process_backlog_loop (h264parse,
h264parse->bl_next_nal); h264parse->nal_backlog->len, TRUE, aud_insert, data, &framesize)) {
next_is_aud = bnalu->type == GST_H264_NAL_AU_DELIMITER; goto fail;
} }
/* Process all backlog. Used when draining or in NAL mode and nals still if (clear_bl) {
* in backlog after completing or next is AUD. */ gst_h264_parse_clear_backlog (h264parse);
if ((au_completed || drain || next_is_aud)) {
if (!gst_h264_parse_process_backlog_loop (h264parse,
h264parse->nal_backlog->len, TRUE, aud_insert, data, &framesize)) {
goto fail;
}
} }
/* Backlog content doesn't need to parsed again, adjust offset accordingly. */ /* Backlog content doesn't need to parsed again, adjust offset accordingly. */
@ -2036,7 +2031,7 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) { if (h264parse->align == GST_H264_PARSE_ALIGN_NAL) {
if (!gst_h264_parse_process_backlog_nal (h264parse, &framesize, if (!gst_h264_parse_process_backlog_nal (h264parse, &framesize,
&h264parse->aud_insert, data, drain, &h264parse->aud_insert, data, FALSE,
blstatus == GST_H264_PARSE_BACKLOG_STATUS_AU_COMPLETE)) { blstatus == GST_H264_PARSE_BACKLOG_STATUS_AU_COMPLETE)) {
*skipsize = current_off; *skipsize = current_off;
} }