V4L spec now requires decode_params flags to be set in accordance to the
frame's type. In particular this is required by H.264 decoder of NVIDIA
Tegra SoC to operate properly. Set the flags based on type of parsed
slices.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1757>
slice->nalu.size);
self->bitstream_map.size += nal_size;
+ switch (slice->header.type % 5) {
+ case GST_H264_P_SLICE:
+ self->decode_params.flags |= V4L2_H264_DECODE_PARAM_FLAG_PFRAME;
+ break;
+
+ case GST_H264_B_SLICE:
+ self->decode_params.flags |= V4L2_H264_DECODE_PARAM_FLAG_BFRAME;
+ break;
+ }
+
return GST_FLOW_OK;
}
#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
#define V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC 0x02
#define V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD 0x04
+#define V4L2_H264_DECODE_PARAM_FLAG_PFRAME 0x08
+#define V4L2_H264_DECODE_PARAM_FLAG_BFRAME 0x10
#define V4L2_CID_STATELESS_H264_DECODE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 7)
/**