libcamera: formats: Support V4L2 non-contiguous formats

V4L2 describes multi-planar formats with different 4CCs depending on
whether or not the planes are stored contiguously in memory. Support
this when translating between PixelFormat and V4L2PixelFormat.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2021-09-02 01:42:10 +03:00
parent 94cbaa381a
commit 1b0bd492c2
3 changed files with 240 additions and 60 deletions

View file

@ -54,7 +54,10 @@ public:
/* \todo Add support for non-contiguous memory planes */
const char *name;
PixelFormat format;
V4L2PixelFormat v4l2Format;
struct {
V4L2PixelFormat single;
V4L2PixelFormat multi;
} v4l2Formats;
unsigned int bitsPerPixel;
enum ColourEncoding colourEncoding;
bool packed;