diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2022-07-29 11:40:02 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2022-08-03 15:07:19 +0200 |
commit | 3bc8844808c5c72f9c83927ec0e93434d9d40e22 (patch) | |
tree | df6f9d1ee6e509da7179437e1e68757fae663589 /include | |
parent | f25ad4a2b16bc8a0d44e8ca11c46f185b47c34b5 (diff) |
libcamera: formats: Merge V4L2 single and multi formats
To each libcamera PixelFormat two V4L2 formats are associated, the
'single' and 'multi' format variants.
The two versions list plane contiguous and non-contiguous format
variants, and an optional argument to V4L2PixelFormat::fromPixelFormat()
was used to select which one to pick.
In order to prepare to remove V4L2PixelFormat::fromPixelFormat(), and
considering that no caller in the codebase uses the non-contiguous
format variant, merge the two formats vectors in a single one and
default the selection to the first available one, which is functionally
equivalent to what is currently implemented.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/formats.h | 5 | ||||
-rw-r--r-- | include/libcamera/internal/v4l2_pixelformat.h | 3 |
2 files changed, 2 insertions, 6 deletions
diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h index ee599765..5b16c0a8 100644 --- a/include/libcamera/internal/formats.h +++ b/include/libcamera/internal/formats.h @@ -53,10 +53,7 @@ public: /* \todo Add support for non-contiguous memory planes */ const char *name; PixelFormat format; - struct { - V4L2PixelFormat single; - V4L2PixelFormat multi; - } v4l2Formats; + std::vector<V4L2PixelFormat> v4l2Formats; unsigned int bitsPerPixel; enum ColourEncoding colourEncoding; bool packed; diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h index 7bd3ea79..ed94baf9 100644 --- a/include/libcamera/internal/v4l2_pixelformat.h +++ b/include/libcamera/internal/v4l2_pixelformat.h @@ -44,8 +44,7 @@ public: const char *description() const; PixelFormat toPixelFormat() const; - static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat, - bool multiplanar = false); + static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat); private: uint32_t fourcc_; |