From bb74aceb5d9d76f5bf4ca11ceb2a9469c0f418fb Mon Sep 17 00:00:00 2001 From: Carlos Bentzen Date: Wed, 5 Feb 2025 17:10:16 +0100 Subject: [PATCH] h266parse: clean up unused APS fields Since APS is always carried in-band, we don't need to keep the APS NALs around in the parser anymore. Part-of: --- .../gst-plugins-bad/gst/videoparsers/gsth266parse.c | 13 +------------ .../gst-plugins-bad/gst/videoparsers/gsth266parse.h | 3 --- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.c b/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.c index 298aa5dfee..4bd3caa2fa 100644 --- a/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.c +++ b/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.c @@ -258,7 +258,7 @@ gst_h266_parse_reset_frame (GstH266Parse * h266parse) static void gst_h266_parse_reset_stream_info (GstH266Parse * h266parse) { - gint i, j; + gint i; h266parse->width = 0; h266parse->height = 0; @@ -297,10 +297,6 @@ gst_h266_parse_reset_stream_info (GstH266Parse * h266parse) gst_buffer_replace (&h266parse->sps_nals[i], NULL); for (i = 0; i < GST_H266_MAX_PPS_COUNT; i++) gst_buffer_replace (&h266parse->pps_nals[i], NULL); - for (i = 0; i < GST_H266_APS_TYPE_MAX; i++) { - for (j = 0; j < GST_H266_MAX_APS_COUNT; j++) - gst_buffer_replace (&h266parse->aps_nals[i][j], NULL); - } gst_video_mastering_display_info_init (&h266parse->mastering_display_info); h266parse->mastering_display_info_state = GST_H266_PARSE_SEI_EXPIRED; @@ -526,11 +522,6 @@ gst_h266_parse_store_nal (GstH266Parse * h266parse, guint id, store_size = GST_H266_MAX_PPS_COUNT; store = h266parse->pps_nals; GST_LOG_OBJECT (h266parse, "storing pps %u", id); - } else if (naltype == GST_H266_NAL_PREFIX_APS || - naltype == GST_H266_NAL_SUFFIX_APS) { - store_size = GST_H266_MAX_APS_COUNT; - store = h266parse->aps_nals[params_type]; - GST_LOG_OBJECT (h266parse, "storing aps %u", id); } else { g_return_if_reached (); } @@ -797,8 +788,6 @@ gst_h266_parse_process_nal (GstH266Parse * h266parse, GstH266NalUnit * nalu) return FALSE; } - gst_h266_parse_store_nal (h266parse, aps->aps_id, nal_type, - aps->params_type, nalu); h266parse->header = TRUE; if (nal_type == GST_H266_NAL_PREFIX_APS) diff --git a/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.h b/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.h index 6baa511ee2..ced30b0d56 100644 --- a/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.h +++ b/subprojects/gst-plugins-bad/gst/videoparsers/gsth266parse.h @@ -90,13 +90,11 @@ struct _GstH266Parse gboolean have_vps; gboolean have_sps; gboolean have_pps; - gboolean have_aps; /* per frame vps/sps/pps/aps check for periodic push codec decision */ gboolean have_vps_in_frame; gboolean have_sps_in_frame; gboolean have_pps_in_frame; - gboolean have_aps_in_frame; gboolean first_frame; @@ -104,7 +102,6 @@ struct _GstH266Parse GstBuffer *vps_nals[GST_H266_MAX_VPS_COUNT]; GstBuffer *sps_nals[GST_H266_MAX_SPS_COUNT]; GstBuffer *pps_nals[GST_H266_MAX_PPS_COUNT]; - GstBuffer *aps_nals[GST_H266_APS_TYPE_MAX][GST_H266_MAX_APS_COUNT]; /* FFI SEI Info we need to keep track of */ GstH266FrameFieldInfo sei_frame_field;