media: allegro: add SPS/PPS nal unit writer
authorMichael Tretter <m.tretter@pengutronix.de>
Tue, 28 May 2019 17:11:20 +0000 (13:11 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 29 May 2019 10:42:36 +0000 (06:42 -0400)
commit878344de61d0d5f351a1b84fce009a321be3eb45
tree2e8ca7f2a77d350f46f54eb01bdb17a157e47ec9
parentf20387dfd065693ba7ea2788a2f893bf653c9cb8
media: allegro: add SPS/PPS nal unit writer

The allegro hardware encoder does not write SPS/PPS nal units into the
encoded video stream. Therefore, we need to write the units in software.

The implementation follows Rec. ITU-T H.264 (04/2017) to allow to
convert between a C struct and the RBSP representation of the SPS and
PPS nal units.

The allegro driver writes the nal units into the v4l2 capture buffer in
front of the actual video data which is written at an offset by the IP
core. The remaining gap is filled with a filler nal unit.

[hverkuil-cisco@xs4all.nl: added missing @dev description for nal_h264_read_sps()]
[mchehab+samsung@kernel.org: removed uneeded "-ccflags-y $(src)" from Makefile]

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/media/allegro-dvt/Makefile
drivers/staging/media/allegro-dvt/allegro-core.c
drivers/staging/media/allegro-dvt/nal-h264.c [new file with mode: 0644]
drivers/staging/media/allegro-dvt/nal-h264.h [new file with mode: 0644]