]> 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)
commite0c2db2187d01de2dc001c8883896b93d46432ac
treefdad269c9a97b0d0d13566f44baef079ab72b4c8
parent113589fb901187cb2e8961a766c534938a10d68a
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