From 1b4121fded234b720c8bda695f95a372e57e66b1 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Thu, 28 Apr 2022 03:14:54 +0900 Subject: [PATCH] av1decoder: Hold OBU temporal and spatial id in picture struct NVDEC API requires the information Part-of: --- .../gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c | 8 +++++--- .../gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c index e3acbacee5..5b971ed816 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c @@ -323,7 +323,7 @@ gst_av1_decoder_decode_tile_group (GstAV1Decoder * self, static GstFlowReturn gst_av1_decoder_decode_frame_header (GstAV1Decoder * self, - GstAV1FrameHeaderOBU * frame_header) + GstAV1OBU * obu, GstAV1FrameHeaderOBU * frame_header) { GstAV1DecoderPrivate *priv = self->priv; GstAV1DecoderClass *klass = GST_AV1_DECODER_GET_CLASS (self); @@ -367,6 +367,8 @@ gst_av1_decoder_decode_frame_header (GstAV1Decoder * self, picture->showable_frame = frame_header->showable_frame; picture->apply_grain = frame_header->film_grain_params.apply_grain; picture->system_frame_number = priv->current_frame->system_frame_number; + picture->temporal_id = obu->header.obu_temporal_id; + picture->spatial_id = obu->header.obu_spatial_id; if (!frame_header->show_frame && !frame_header->showable_frame) GST_VIDEO_CODEC_FRAME_FLAG_SET (priv->current_frame, @@ -409,7 +411,7 @@ gst_av1_decoder_process_frame_header (GstAV1Decoder * self, GstAV1OBU * obu) return GST_FLOW_ERROR; } - return gst_av1_decoder_decode_frame_header (self, &frame_header); + return gst_av1_decoder_decode_frame_header (self, obu, &frame_header); } static GstFlowReturn @@ -442,7 +444,7 @@ gst_av1_decoder_process_frame (GstAV1Decoder * self, GstAV1OBU * obu) return GST_FLOW_ERROR; } - ret = gst_av1_decoder_decode_frame_header (self, &frame.frame_header); + ret = gst_av1_decoder_decode_frame_header (self, obu, &frame.frame_header); if (ret != GST_FLOW_OK) return ret; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h index 3131718861..f0d8a706d0 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h @@ -66,6 +66,7 @@ struct _GstAV1Tile */ struct _GstAV1Picture { + /*< private >*/ GstMiniObject parent; /* From GstVideoCodecFrame */ @@ -73,6 +74,10 @@ struct _GstAV1Picture GstAV1FrameHeaderOBU frame_hdr; + /* from OBU header */ + guint8 temporal_id; + guint8 spatial_id; + /* copied from parser */ guint32 display_frame_id; gboolean show_frame;