From efa360ce82b81bce9cdfa830e88e34ebe080b872 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 23 Mar 2022 09:11:35 -0400 Subject: [PATCH] v4l2codecs: h264: Set other field poc if available Whenever the other field POC is available, pass it back to the driver. This should not be strictly required, but it makes things easier to debug and more forgiven. Part-of: --- .../gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c index 4da59cd..406ed79 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c @@ -559,19 +559,26 @@ gst_v4l2_codec_h264_dec_fill_decoder_params (GstV4l2CodecH264Dec * self, (slice_hdr->field_pic_flag ? V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC : 0) | (slice_hdr->bottom_field_flag ? V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD : 0), }; + /* *INDENT-ON* */ switch (picture->field) { case GST_H264_PICTURE_FIELD_FRAME: self->decode_params.top_field_order_cnt = picture->top_field_order_cnt; self->decode_params.bottom_field_order_cnt = - picture->bottom_field_order_cnt; + picture->bottom_field_order_cnt; break; case GST_H264_PICTURE_FIELD_TOP_FIELD: self->decode_params.top_field_order_cnt = picture->top_field_order_cnt; self->decode_params.bottom_field_order_cnt = 0; + if (picture->other_field) + self->decode_params.bottom_field_order_cnt = + picture->other_field->bottom_field_order_cnt; break; case GST_H264_PICTURE_FIELD_BOTTOM_FIELD: self->decode_params.top_field_order_cnt = 0; + if (picture->other_field) + self->decode_params.top_field_order_cnt = + picture->other_field->top_field_order_cnt; self->decode_params.bottom_field_order_cnt = picture->bottom_field_order_cnt; break; @@ -599,6 +606,7 @@ gst_v4l2_codec_h264_dec_fill_decoder_params (GstV4l2CodecH264Dec * self, } entry = &self->decode_params.dpb[entry_id++]; + /* *INDENT-OFF* */ *entry = (struct v4l2_h264_dpb_entry) { /* * The reference is multiplied by 1000 because it's was set as micro @@ -636,7 +644,7 @@ gst_v4l2_codec_h264_dec_fill_decoder_params (GstV4l2CodecH264Dec * self, if (ref_pic->other_field) { entry->top_field_order_cnt = - ref_pic->other_field->top_field_order_cnt; + ref_pic->other_field->top_field_order_cnt; entry->fields |= V4L2_H264_TOP_FIELD_REF; } break; -- 2.7.4