mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
codecs: GstMpeg2Slice: add field for sc_offset and size
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>
This commit is contained in:
parent
8b932c105f
commit
946be1a85a
2 changed files with 6 additions and 0 deletions
|
@ -949,6 +949,8 @@ gst_mpeg2_decoder_handle_slice (GstMpeg2Decoder * decoder,
|
|||
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) {
|
||||
|
|
|
@ -65,6 +65,10 @@ struct _GstMpeg2Slice
|
|||
|
||||
/* 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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue