Downstream might need the start code offset when decoding.
Previously this computation would be scattered in multiple sites. This
is error prone, so move it to the base class. Subclasses can access
slice->sc_offset directly without computing the address themselves
knowing that the size will also take the start code into account.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1013>
slice.pic_hdr = &priv->pic_hdr;
slice.pic_ext = _pic_hdr_ext_is_valid (&priv->pic_ext) ?
&priv->pic_ext : NULL;
+ slice.sc_offset = slice.packet.offset - 4;
+ slice.size = slice.packet.size + 4;
ret = gst_mpeg2_decoder_ensure_current_picture (decoder, &slice);
if (ret != GST_FLOW_OK) {
/* parsed video packet (doesn't take ownership of raw data) */
GstMpegVideoPacket packet;
+ /* offset of the start code for the slice */
+ guint sc_offset;
+ /* size, including the start code */
+ guint size;
};
/**