[libcamera-devel,v2,0/2] Fix colour spaces on Raspberry Pi
mbox series

Message ID 20230103113313.5423-1-david.plowman@raspberrypi.com
Headers show
Series
  • Fix colour spaces on Raspberry Pi
Related show

Message

David Plowman Jan. 3, 2023, 11:33 a.m. UTC
Hi everyone

This is an alternative (and I think better, in many respects) version
of my previous attempt to fix the broken colour spaces on the
Raspberry Pi. I've side-stepped the issue of what to do about the base
class version of validateColorSpaces and implemented a specific
version for the Pi instead.

There are just 2 commits now:

The first commit is the same as before, I've fixed the "obvious" bug
in CameraConfiguration::validateColorSpaces because it is just wrong.

The other adjustments to that method (the 2nd patch in the previous
version) have been dropped. The Pi is going to use a custom version
(the remaining patch described below), so it's really up to the rkisp1
whether this function is still useful, or should be changed.

I'm unconvinced that the idea of "sharing a colour space" makes much
sense seeing as you can no longer do it when you have both YUV and RGB
streams, so the whole thing seems more trouble that it's
worth. Arguably, this flag and the associated functionality should
perhaps be removed? I'd be interested to hear opinions on that.

The final patch here implements a custom validateColorSpaces for the
Pi. Creating a custom method makes it easier to understand the
constraints we have and how I want this to work. We still have to be a
bit careful to pass the right values to the device, and to interpret
correctly what gets returned, depending on whether it was a YUV or RGB
stream.

Hope that makes sense!

Thanks
David


David Plowman (2):
  libcamera: camera: fix validateColorSpaces to choose the correct
    "main" colour space
  pipeline: raspberrypi: Fix handling of colour spaces

 src/libcamera/camera.cpp                      |  6 +-
 .../pipeline/raspberrypi/raspberrypi.cpp      | 99 ++++++++++++++++++-
 2 files changed, 102 insertions(+), 3 deletions(-)