summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index a3242ba7..767ab236 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1992,23 +1992,24 @@ V4L2VideoDevice::fromEntityName(const MediaDevice *media,
/**
* \brief Convert \a PixelFormat to one of the device supported V4L2 FourCC
* \param[in] pixelFormat The PixelFormat to convert
+ * \param[in] multiplanar Use the multiplanar format version, default to false
*
* Convert a\ pixelformat to a V4L2 FourCC that is known to be supported by
* the video device.
*
- * For multiplanar formats, the V4L2 format variant (contiguous or
- * non-contiguous planes) is selected automatically based on the capabilities
- * of the video device. If the video device supports the V4L2 multiplanar API,
- * non-contiguous formats are preferred.
+ * V4L2 defines different format variants for the same format when using
+ * contiguous or non-contiguous planes. The \a multiplanar parameter allows
+ * to select which variant to use.
*
* \return The V4L2PixelFormat corresponding to \a pixelFormat or an invalid
* PixelFormat if \a pixelFormat is not supported by the video device
*/
-V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat) const
+V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelFormat,
+ bool multiplanar) const
{
std::vector<V4L2PixelFormat> deviceFormats = enumPixelformats(0);
std::vector<V4L2PixelFormat> v4l2PixelFormats =
- V4L2PixelFormat::fromPixelFormat(pixelFormat, caps_.isMultiplanar());
+ V4L2PixelFormat::fromPixelFormat(pixelFormat, multiplanar);
for (const V4L2PixelFormat &v4l2Format : v4l2PixelFormats) {
auto it = std::find_if(deviceFormats.begin(), deviceFormats.end(),