[libcamera-devel] [PATCH v7 0/7] Colour spaces

David Plowman david.plowman at raspberrypi.com
Fri Nov 26 11:40:38 CET 2021


Hi everyone

Here's version 7 of the colour space patches.

Mostly it's just tidying up, improving documentation and making things
a bit clearer, so thank you very much for all those suggestions.

The other change is that I've decided to leave it up to the caller to
check what has happened when you try to set a colour space. As some
have pointed out, some pads already don't have colour spaces, and
there might be more in future. I think it's only really the pipeline
handler that understands this context, so it's best so leave it to the
pipeline handler to check.

I also decided to leave the to/fromColorSpace methods public. I could
imagine a day in the future when a pipeline handler might want to
check (for example) that V4L2 understands the ColorSpace it wants to
use, and these methods give a handy way to do that.

Thanks again for all the reviews so far!

Best regards
David

David Plowman (7):
  libcamera: Add ColorSpace class
  libcamera: Add ColorSpace fields to StreamConfiguration
  libcamera: Convert between ColorSpace class and V4L2 formats
  libcamera: Support passing ColorSpaces to V4L2 video devices
  libcamera: Support passing ColorSpaces to V4L2 subdevices
  libcamera: Add validateColorSpaces to CameraConfiguration class
  libcamera: pipeline: raspberrypi: Support color spaces

 include/libcamera/camera.h                    |   2 +
 include/libcamera/color_space.h               |  72 +++++
 include/libcamera/internal/v4l2_device.h      |   7 +
 include/libcamera/internal/v4l2_subdevice.h   |   2 +
 include/libcamera/internal/v4l2_videodevice.h |   2 +
 include/libcamera/meson.build                 |   1 +
 include/libcamera/stream.h                    |   3 +
 src/libcamera/camera.cpp                      |  38 +++
 src/libcamera/camera_sensor.cpp               |   1 +
 src/libcamera/color_space.cpp                 | 305 ++++++++++++++++++
 src/libcamera/meson.build                     |   1 +
 .../pipeline/raspberrypi/raspberrypi.cpp      |  42 +++
 src/libcamera/stream.cpp                      |  19 ++
 src/libcamera/v4l2_device.cpp                 | 192 +++++++++++
 src/libcamera/v4l2_subdevice.cpp              |  25 +-
 src/libcamera/v4l2_videodevice.cpp            |  32 ++
 16 files changed, 743 insertions(+), 1 deletion(-)
 create mode 100644 include/libcamera/color_space.h
 create mode 100644 src/libcamera/color_space.cpp

-- 
2.30.2



More information about the libcamera-devel mailing list