summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-07-29 12:37:29 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-08-03 15:07:20 +0200
commitb7ca378b65e8ba936bf3c5631e16534a3376aec9 (patch)
tree81d7112608ebb1eef8e05f61406c0617e0f30954 /src/libcamera/v4l2_videodevice.cpp
parent45736468c8395de02f004f6543dab91ff43dd71c (diff)
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>
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index f41afa06..2ca22f48 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -2000,7 +2000,7 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media,
*/
V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat) const
{
- return V4L2PixelFormat::fromPixelFormat(pixelFormat);
+ return V4L2PixelFormat::fromPixelFormat(pixelFormat)[0];
}
/**