Commit b20c6fe6 authored by Nicolas Dufresne's avatar Nicolas Dufresne

v4l2slh264dec: Renew bitstream buffer after submitting slice

Submitting a slice actually clears the bitstream buffer. Ensure we
have a newly allocated bitstream buffer for the next slice.

Part-of: <!1395>
parent bc1a0323
......@@ -1041,20 +1041,25 @@ gst_v4l2_codec_h264_dec_decode_slice (GstH264Decoder * decoder,
GstV4l2CodecH264Dec *self = GST_V4L2_CODEC_H264_DEC (decoder);
gsize sc_off = 0;
gsize nal_size;
guint8 *bitstream_data = self->bitstream_map.data + self->bitstream_map.size;
guint8 *bitstream_data;
if (is_slice_based (self)) {
/* In slice mode, we submit the pending slice asking the acceletator to hold
* on the picture */
if (self->bitstream_map.size)
gst_v4l2_codec_h264_dec_submit_bitstream (self, picture,
V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF);
if (self->bitstream_map.size) {
/* In slice mode, we submit the pending slice asking the accelerator to
* hold on the picture */
if (!gst_v4l2_codec_h264_dec_submit_bitstream (self, picture,
V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF)
|| !gst_v4l2_codec_h264_dec_ensure_bitstream (self))
return FALSE;
}
gst_v4l2_codec_h264_dec_fill_slice_params (self, slice);
gst_v4l2_codec_h264_dec_fill_references (self, ref_pic_list0,
ref_pic_list1);
}
bitstream_data = self->bitstream_map.data + self->bitstream_map.size;
if (needs_start_codes (self))
sc_off = 3;
nal_size = sc_off + slice->nalu.size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment