sys: va: GstVaMpeg2Dec: use slice sc_offset and size

Seeing as how GstMpeg2Slice will now record the start code offset
as well as its size with the above field taken into account, the
manual computation in this class is not needed.

Remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1013>
This commit is contained in:
Daniel Almeida 2021-03-26 15:52:21 -03:00 committed by GStreamer Marge Bot
parent 946be1a85a
commit f6e17ea294

View file

@ -520,15 +520,9 @@ gst_va_mpeg2_dec_decode_slice (GstMpeg2Decoder * decoder,
GstVaDecodePicture *va_pic;
VASliceParameterBufferMPEG2 slice_param;
/* The slice data pass to driver should be a full packet
include the start code. The packet->offset return by
gst_mpeg_video_parse does not include the start code
and so we need to wrap back 4 bytes. */
g_assert (packet->offset >= 4);
/* *INDENT-OFF* */
slice_param = (VASliceParameterBufferMPEG2) {
.slice_data_size = packet->size + 4 /* start code */,
.slice_data_size = slice->size,
.slice_data_offset = 0,
.slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
.macroblock_offset = header->header_size + 32,
@ -542,8 +536,7 @@ gst_va_mpeg2_dec_decode_slice (GstMpeg2Decoder * decoder,
va_pic = gst_mpeg2_picture_get_user_data (picture);
if (!gst_va_decoder_add_slice_buffer (base->decoder, va_pic,
&slice_param, sizeof (slice_param),
(guint8 *) (packet->data + packet->offset - 4 /* start code */ ),
packet->size + 4 /* start code */ ))
(guint8 *) (packet->data + slice->sc_offset), slice->size))
return GST_FLOW_ERROR;
return GST_FLOW_OK;