mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
rtph264depay: minor refactoring of FU handling code
Make code easier to follow, and prepare for next commit. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6607>
This commit is contained in:
parent
777c8a9b15
commit
b1a45b527a
1 changed files with 7 additions and 6 deletions
|
@ -1344,18 +1344,19 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
|
|||
/* reconstruct NAL header */
|
||||
nal_header = (payload[0] & 0xe0) | (payload[1] & 0x1f);
|
||||
|
||||
/* strip type header, keep FU header, we'll reuse it to reconstruct
|
||||
* the NAL header. */
|
||||
payload += 1;
|
||||
payload_len -= 1;
|
||||
/* Strip type header, FU header */
|
||||
payload += 2;
|
||||
payload_len -= 2;
|
||||
|
||||
nalu_size = payload_len;
|
||||
nalu_size = 1 + payload_len;
|
||||
outsize = nalu_size + sizeof (sync_bytes);
|
||||
outbuf = gst_buffer_new_and_alloc (outsize);
|
||||
|
||||
/* Sync_bytes or nalu_length will be set later once NALU is complete.
|
||||
* Need to reconstruct NALU header from type header and FU header. */
|
||||
gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
|
||||
memcpy (map.data + sizeof (sync_bytes), payload, nalu_size);
|
||||
map.data[sizeof (sync_bytes)] = nal_header;
|
||||
memcpy (map.data + sizeof (sync_bytes) + 1, payload, payload_len);
|
||||
gst_buffer_unmap (outbuf, &map);
|
||||
|
||||
gst_rtp_copy_video_meta (rtph264depay, outbuf, rtp->buffer);
|
||||
|
|
Loading…
Reference in a new issue