rpicamsrc: fix nal alignment of output buffers
authorTim-Philipp Müller <tim@centricular.com>
Fri, 24 Jul 2020 15:14:00 +0000 (16:14 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 24 Jul 2020 16:09:45 +0000 (17:09 +0100)
commit9588108d6e548964c07bd1cf0c8a3337ea803155
tree239960215e8e93996b8f92686f9071c945803850
parent477eba2dd7aff757f34566af28bf2e77c5e4227b
rpicamsrc: fix nal alignment of output buffers

We claim output buffers are nal-aligned, but that wasn't
actually true: We would push out a partial nal in case
the nal doesn't fit into the max encoder-selected output
buffer size, and then the next buffer would not start
with a sync marker. That's not right and makes h264parse
unhappy.

Instead accumulate buffers until we have a full frame
(we can't rely on the NAL_END flag, it's always set).

Fixes #768

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/682>
sys/rpicamsrc/RaspiCapture.c
sys/rpicamsrc/RaspiCapture.h
sys/rpicamsrc/gstrpicamsrc.c