libcamera: v4l2_pixelformat: Return the list of V4L2 formats

Multiple V4L2 formats can be associated with a single PixelFormat.
Now that users of V4L2PixelFormat::fromPixelFormat() have been converted
to use V4L2VideoDevice::toV4L2PixelFormat(), return the full list of
V4L2 formats in order to prepare to match them against the ones
supported by the video device.

The V4L2 compatibility layer, not having any video device to interact
with, is converted to use the first returned format unconditionally.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Jacopo Mondi 2022-07-29 12:37:29 +02:00
parent 45736468c8
commit b7ca378b65
4 changed files with 15 additions and 11 deletions

View file

@ -11,6 +11,7 @@
#include <ostream>
#include <stdint.h>
#include <string>
#include <vector>
#include <linux/videodev2.h>
@ -44,7 +45,8 @@ public:
const char *description() const;
PixelFormat toPixelFormat() const;
static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat);
static const std::vector<V4L2PixelFormat> &
fromPixelFormat(const PixelFormat &pixelFormat);
private:
uint32_t fourcc_;