From 104ae1b2e65298f5ca72b5fba664bd5eb1e5d480 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 21 Dec 2021 10:52:32 -0500 Subject: [PATCH] codecs: h264: Save the field_pic_flag This flag is set when the stream is interlaced and the specific slice is made of single parity fields rather the paired at the macroblock layer. This is rarely needed in late decoding process but the Rockchip RKVDEC HW interface requires it, hence needs to be passed through V4L2 Stateless interface. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c | 3 +++ subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h | 1 + 2 files changed, 4 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c index b9abcf8..eae8687 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c @@ -823,6 +823,7 @@ gst_h264_decoder_split_frame (GstH264Decoder * self, GstH264Picture * picture) other_field->ref = picture->ref; other_field->nonexisting = picture->nonexisting; other_field->system_frame_number = picture->system_frame_number; + other_field->field_pic_flag = picture->field_pic_flag; return other_field; } @@ -1515,6 +1516,8 @@ gst_h264_decoder_fill_picture_from_slice (GstH264Decoder * self, picture->idr = slice->nalu.idr_pic_flag; picture->dec_ref_pic_marking = slice_hdr->dec_ref_pic_marking; + picture->field_pic_flag = slice_hdr->field_pic_flag; + if (picture->idr) picture->idr_pic_id = slice_hdr->idr_pic_id; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h index 3546800..3893381 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h @@ -142,6 +142,7 @@ struct _GstH264Picture gint nal_ref_idc; gboolean idr; gint idr_pic_id; + gboolean field_pic_flag; GstH264PictureReference ref; /* Whether a reference picture. */ gboolean ref_pic; -- 2.7.4