Revert "h264parse: use AUD to detect first VCL NAL"

This reverts commit 90a3b63eed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6540>
This commit is contained in:
Daniel Morin 2024-04-04 09:37:40 -04:00 committed by GStreamer Marge Bot
parent 0bc5d97321
commit 6ff1973b5b
2 changed files with 3 additions and 21 deletions

View file

@ -224,7 +224,6 @@ gst_h264_parse_init (GstH264Parse * h264parse)
h264parse->bl_next_au_first_vcl = 1; h264parse->bl_next_au_first_vcl = 1;
h264parse->bl_next_au_first_nal = 1; h264parse->bl_next_au_first_nal = 1;
h264parse->bl_next_nal = 0; h264parse->bl_next_nal = 0;
h264parse->bl_last_aud_nal = -1;
h264parse->history_slice[HIST_IDX_CURR].valid = FALSE; h264parse->history_slice[HIST_IDX_CURR].valid = FALSE;
h264parse->history_slice[HIST_IDX_PREV].valid = FALSE; h264parse->history_slice[HIST_IDX_PREV].valid = FALSE;
@ -1547,7 +1546,6 @@ gst_h264_parse_update_backlog (GstH264Parse * h264parse, GstH264NalUnit * nalu)
h264parse->bl_next_au_first_vcl = 1; h264parse->bl_next_au_first_vcl = 1;
h264parse->bl_next_au_first_nal = 1; h264parse->bl_next_au_first_nal = 1;
h264parse->bl_next_nal = 0; h264parse->bl_next_nal = 0;
h264parse->bl_last_aud_nal = -1;
g_array_set_size (h264parse->nal_backlog, 0); g_array_set_size (h264parse->nal_backlog, 0);
GST_DEBUG_OBJECT (h264parse, "Failed to parse slice header"); GST_DEBUG_OBJECT (h264parse, "Failed to parse slice header");
@ -1563,12 +1561,6 @@ gst_h264_parse_update_backlog (GstH264Parse * h264parse, GstH264NalUnit * nalu)
h264parse->bl_next_au_first_nal = h264parse->bl_next_au_first_vcl; h264parse->bl_next_au_first_nal = h264parse->bl_next_au_first_vcl;
} else { } else {
if (!is_first_vcl_nal) {
is_first_vcl_nal =
h264parse->bl_last_aud_nal > h264parse->bl_curr_au_last_vcl;
}
h264parse->bl_last_aud_nal = -1;
if (is_first_vcl_nal) { if (is_first_vcl_nal) {
h264parse->bl_next_au_first_vcl = LAST_IDX; h264parse->bl_next_au_first_vcl = LAST_IDX;
@ -1593,8 +1585,6 @@ gst_h264_parse_update_backlog (GstH264Parse * h264parse, GstH264NalUnit * nalu)
} }
break; break;
case GST_H264_NAL_AU_DELIMITER:
h264parse->bl_last_aud_nal = LAST_IDX;
default: default:
if (h264parse->bl_curr_au_last_vcl == -1) { if (h264parse->bl_curr_au_last_vcl == -1) {
/* if we didn't receive any vcl, any nal from next au hasn't been /* if we didn't receive any vcl, any nal from next au hasn't been
@ -1652,7 +1642,6 @@ gst_h264_parse_trim_backlog (GstH264Parse * h264parse)
h264parse->bl_next_nal = 0; h264parse->bl_next_nal = 0;
h264parse->bl_curr_au_last_vcl = h264parse->bl_curr_au_last_vcl =
h264parse->bl_next_au_first_vcl - h264parse->bl_next_au_first_nal; h264parse->bl_next_au_first_vcl - h264parse->bl_next_au_first_nal;
h264parse->bl_last_aud_nal -= h264parse->bl_curr_au_last_vcl;
h264parse->bl_next_au_first_nal = h264parse->bl_curr_au_last_vcl + 1; h264parse->bl_next_au_first_nal = h264parse->bl_curr_au_last_vcl + 1;
h264parse->bl_next_au_first_vcl = h264parse->bl_next_au_first_nal; h264parse->bl_next_au_first_vcl = h264parse->bl_next_au_first_nal;
} }
@ -1665,8 +1654,6 @@ gst_h264_parse_clear_backlog (GstH264Parse * h264parse)
h264parse->bl_curr_au_last_vcl = -1; h264parse->bl_curr_au_last_vcl = -1;
h264parse->bl_next_au_first_nal = 1; h264parse->bl_next_au_first_nal = 1;
h264parse->bl_next_au_first_vcl = 1; h264parse->bl_next_au_first_vcl = 1;
h264parse->bl_last_aud_nal = -1;
} }
static gboolean static gboolean
@ -2019,8 +2006,8 @@ gst_h264_parse_handle_frame (GstBaseParse * parse,
blstatus = gst_h264_parse_update_backlog (h264parse, &nalu); blstatus = gst_h264_parse_update_backlog (h264parse, &nalu);
if (blstatus == GST_H264_PARSE_BACKLOG_STATUS_UPD_FAILED) { if (blstatus == GST_H264_PARSE_BACKLOG_STATUS_UPD_FAILED) {
*skipsize = nalu.size + nalu.offset; *skipsize = current_off;
GST_WARNING_OBJECT (h264parse, "Failed to update backlog"); GST_ERROR_OBJECT (h264parse, "Failed to update backlog");
goto skip; goto skip;
} else if (blstatus == GST_H264_PARSE_BACKLOG_STATUS_NOT_SUPPORTED) { } else if (blstatus == GST_H264_PARSE_BACKLOG_STATUS_NOT_SUPPORTED) {
/* SVC is not supported */ /* SVC is not supported */
@ -2110,10 +2097,8 @@ skip:
* slice NAL was received. This means that broken pictures are discarded */ * slice NAL was received. This means that broken pictures are discarded */
if (h264parse->align != GST_H264_PARSE_ALIGN_AU || if (h264parse->align != GST_H264_PARSE_ALIGN_AU ||
!(h264parse->state & GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS) || !(h264parse->state & GST_H264_PARSE_STATE_VALID_PICTURE_HEADERS) ||
(h264parse->state & GST_H264_PARSE_STATE_GOT_SLICE)) { (h264parse->state & GST_H264_PARSE_STATE_GOT_SLICE))
gst_h264_parse_reset_frame (h264parse); gst_h264_parse_reset_frame (h264parse);
h264parse->current_off = -1;
}
goto out; goto out;
invalid_stream: invalid_stream:

View file

@ -206,9 +206,6 @@ struct _GstH264Parse
/* Index of next nal to be processed in backlog */ /* Index of next nal to be processed in backlog */
gint bl_next_nal; gint bl_next_nal;
/* Index of last AUD */
gint bl_last_aud_nal;
GstVideoParseUserData user_data; GstVideoParseUserData user_data;
GstVideoParseUserDataUnregistered user_data_unregistered; GstVideoParseUserDataUnregistered user_data_unregistered;