summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-07-15 14:53:43 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-07-23 10:54:53 +0200
commit953879a15d83704d86a0b054a06d8e2d4730a2cb (patch)
treeb3ba099ebc427268b2fad8c771e0554ae562c204 /include
parentcd374f31e06e9b334f88d6b32be80094f3781742 (diff)
libcamera: v4l2_pixelformat: Return a format list in fromPixelFormat()
As we prepare to associate multiple V4L2 FourCC to a single libcamera format, make the V4L2PixelFormat::fromPixelFormat() return a list of formats and convert all its users to pick the first one. This change prepares to re-introduce V4L2VideoDevice::toV4L2PixelFormat() which will instead match the list of V4L2 FourCC against the formats supported by the video device. While at it, reword the V4L2PixelFormat::fromPixelFormat() documentation to distinguish between planar/multiplanar and contiguous/non-contiguous. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/v4l2_pixelformat.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h
index fb2d5d0b..750f31fc 100644
--- a/include/libcamera/internal/v4l2_pixelformat.h
+++ b/include/libcamera/internal/v4l2_pixelformat.h
@@ -11,6 +11,7 @@
#include <ostream>
#include <stdint.h>
#include <string>
+#include <vector>
#include <linux/videodev2.h>
@@ -44,8 +45,9 @@ public:
const char *description() const;
PixelFormat toPixelFormat() const;
- static V4L2PixelFormat fromPixelFormat(const PixelFormat &pixelFormat,
- bool multiplanar = false);
+ static std::vector<V4L2PixelFormat>
+ fromPixelFormat(const PixelFormat &pixelFormat,
+ bool multiplanar = false);
private:
uint32_t fourcc_;