]> git.baikalelectronics.ru Git - kernel.git/commit
media: allegro: write correct colorspace into SPS
authorMichael Tretter <m.tretter@pengutronix.de>
Wed, 8 Sep 2021 13:03:53 +0000 (14:03 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 Oct 2021 15:00:28 +0000 (16:00 +0100)
commit1b73a0da53837ea1dcc06cc00212038e259c547b
treefdad269c9a97b0d0d13566f44baef079ab72b4c8
parent1bf4c9111dc3e11ab45d2f2111adc47618fb373d
media: allegro: write correct colorspace into SPS

Currently, the driver always writes PAL as video format into the SPS of
the encoded stream.

Set the video format to the default value 5 (unspecified) and use the
color description that is already configured on the channel as color
space. This fixes the color space definition in the coded data to
reflect the configured color space of the video data that is encoded.

Add lookup functions to convert the color primaries, transfer function
and matrix coefficients from the V4L2 control values to the values
specified in the h.264 standard.

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+huawei@kernel.org>
drivers/media/platform/allegro-dvt/allegro-core.c
drivers/media/platform/allegro-dvt/nal-h264.h