summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 5a2d0e5b..0e3f5436 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -931,7 +931,8 @@ int V4L2VideoDevice::getFormatMultiplane(V4L2DeviceFormat *format)
format->size.height = pix->height;
format->fourcc = V4L2PixelFormat(pix->pixelformat);
format->planesCount = pix->num_planes;
- format->colorSpace = toColorSpace(*pix);
+ format->colorSpace =
+ toColorSpace(*pix, PixelFormatInfo::info(format->fourcc).colourEncoding);
for (unsigned int i = 0; i < format->planesCount; ++i) {
format->planes[i].bpl = pix->plane_fmt[i].bytesperline;
@@ -987,7 +988,8 @@ int V4L2VideoDevice::trySetFormatMultiplane(V4L2DeviceFormat *format, bool set)
format->planes[i].bpl = pix->plane_fmt[i].bytesperline;
format->planes[i].size = pix->plane_fmt[i].sizeimage;
}
- format->colorSpace = toColorSpace(*pix);
+ format->colorSpace =
+ toColorSpace(*pix, PixelFormatInfo::info(format->fourcc).colourEncoding);
return 0;
}
@@ -1011,7 +1013,8 @@ int V4L2VideoDevice::getFormatSingleplane(V4L2DeviceFormat *format)
format->planesCount = 1;
format->planes[0].bpl = pix->bytesperline;
format->planes[0].size = pix->sizeimage;
- format->colorSpace = toColorSpace(*pix);
+ format->colorSpace =
+ toColorSpace(*pix, PixelFormatInfo::info(format->fourcc).colourEncoding);
return 0;
}
@@ -1053,7 +1056,8 @@ int V4L2VideoDevice::trySetFormatSingleplane(V4L2DeviceFormat *format, bool set)
format->planesCount = 1;
format->planes[0].bpl = pix->bytesperline;
format->planes[0].size = pix->sizeimage;
- format->colorSpace = toColorSpace(*pix);
+ format->colorSpace =
+ toColorSpace(*pix, PixelFormatInfo::info(format->fourcc).colourEncoding);
return 0;
}