[{"id":20421,"web_url":"https://patchwork.libcamera.org/comment/20421/","msgid":"<CAEmqJPqnA8mQdm=f3SKcUt2whEbWiD8Lr+W-hKeDuowsCsRmYw@mail.gmail.com>","date":"2021-10-25T08:42:10","subject":"Re: [libcamera-devel] [PATCH v3 7/7] libcamera: pipeline:\n\traspberrypi: Support color spaces","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nThank you for your patch.\n\nOn Wed, 20 Oct 2021 at 12:08, David Plowman <david.plowman@raspberrypi.com>\nwrote:\n\n> The Raspberry Pi pipeline handler now sets color spaces correctly.\n>\n> In generateConfiguration() it sets them to reasonable default values\n> based on the stream role.\n>\n> validate() now calls validateColorSpaces() to ensure that the\n> requested color spaces are sensible, before proceeding to check what\n> the hardware can deliver.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  .../pipeline/raspberrypi/raspberrypi.cpp      | 42 +++++++++++++++++++\n>  1 file changed, 42 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 1634ca98..22db54ce 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -288,6 +288,8 @@ CameraConfiguration::Status\n> RPiCameraConfiguration::validate()\n>         if (config_.empty())\n>                 return Invalid;\n>\n> +       status = validateColorSpaces(true);\n> +\n>         /*\n>          * What if the platform has a non-90 degree rotation? We can't even\n>          * \"adjust\" the configuration and carry on. Alternatively, raising\n> an\n> @@ -354,6 +356,7 @@ CameraConfiguration::Status\n> RPiCameraConfiguration::validate()\n>                          */\n>                         V4L2VideoDevice::Formats fmts =\n> data_->unicam_[Unicam::Image].dev()->formats();\n>                         V4L2DeviceFormat sensorFormat = findBestMode(fmts,\n> cfg.size);\n> +                       sensorFormat.colorSpace = ColorSpace::Raw;\n>\n\nThis is going to conflict badly with my media controller changes ;-)\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n>                         int ret =\n> data_->unicam_[Unicam::Image].dev()->tryFormat(&sensorFormat);\n>                         if (ret)\n>                                 return Invalid;\n> @@ -449,10 +452,21 @@ CameraConfiguration::Status\n> RPiCameraConfiguration::validate()\n>                 V4L2DeviceFormat format;\n>                 format.fourcc =\n> V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>                 format.size = cfg.size;\n> +               format.colorSpace = cfg.requestedColorSpace;\n> +               LOG(RPI, Debug)\n> +                       << \"Try color space \" <<\n> cfg.requestedColorSpace.toString();\n>\n>                 int ret = dev->tryFormat(&format);\n>                 if (ret)\n>                         return Invalid;\n> +               cfg.actualColorSpace = format.colorSpace;\n> +               if (cfg.actualColorSpace != cfg.requestedColorSpace) {\n> +                       status = Adjusted;\n> +                       LOG(RPI, Warning)\n> +                               << \"Color space changed from \"\n> +                               << cfg.requestedColorSpace.toString() << \"\n> to \"\n> +                               << cfg.actualColorSpace.toString();\n> +               }\n>\n>                 cfg.stride = format.planes[0].bpl;\n>                 cfg.frameSize = format.planes[0].size;\n> @@ -477,6 +491,7 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>         PixelFormat pixelFormat;\n>         V4L2VideoDevice::Formats fmts;\n>         Size size;\n> +       ColorSpace colorSpace;\n>\n>         if (roles.empty())\n>                 return config;\n> @@ -491,6 +506,7 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                         sensorFormat = findBestMode(fmts, size);\n>                         pixelFormat = sensorFormat.fourcc.toPixelFormat();\n>                         ASSERT(pixelFormat.isValid());\n> +                       colorSpace = ColorSpace::Raw;\n>                         bufferCount = 2;\n>                         rawCount++;\n>                         break;\n> @@ -498,6 +514,7 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                 case StreamRole::StillCapture:\n>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>                         pixelFormat = formats::NV12;\n> +                       colorSpace = ColorSpace::Jpeg;\n>                         /* Return the largest sensor resolution. */\n>                         size = data->sensor_->resolution();\n>                         bufferCount = 1;\n> @@ -515,6 +532,8 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                          */\n>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>                         pixelFormat = formats::YUV420;\n> +                       /* This will be reasonable for many applications.\n> */\n> +                       colorSpace = ColorSpace::Rec709;\n>                         size = { 1920, 1080 };\n>                         bufferCount = 4;\n>                         outCount++;\n> @@ -523,6 +542,7 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                 case StreamRole::Viewfinder:\n>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>                         pixelFormat = formats::ARGB8888;\n> +                       colorSpace = ColorSpace::Jpeg;\n>                         size = { 800, 600 };\n>                         bufferCount = 4;\n>                         outCount++;\n> @@ -554,6 +574,7 @@ CameraConfiguration\n> *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>                 StreamConfiguration cfg(formats);\n>                 cfg.size = size;\n>                 cfg.pixelFormat = pixelFormat;\n> +               cfg.requestedColorSpace = colorSpace;\n>                 cfg.bufferCount = bufferCount;\n>                 config->addConfiguration(cfg);\n>         }\n> @@ -601,6 +622,7 @@ int PipelineHandlerRPi::configure(Camera *camera,\n> CameraConfiguration *config)\n>         /* First calculate the best sensor mode we can use based on the\n> user request. */\n>         V4L2VideoDevice::Formats fmts =\n> data->unicam_[Unicam::Image].dev()->formats();\n>         V4L2DeviceFormat sensorFormat = findBestMode(fmts, rawStream ?\n> sensorSize : maxSize);\n> +       sensorFormat.colorSpace = ColorSpace::Raw;\n>\n>         /*\n>          * Unicam image output format. The ISP input format gets set at\n> start,\n> @@ -650,6 +672,7 @@ int PipelineHandlerRPi::configure(Camera *camera,\n> CameraConfiguration *config)\n>                 V4L2PixelFormat fourcc =\n> V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>                 format.size = cfg.size;\n>                 format.fourcc = fourcc;\n> +               format.colorSpace = cfg.requestedColorSpace;\n>\n>                 LOG(RPI, Debug) << \"Setting \" << stream->name() << \" to \"\n>                                 << format.toString();\n> @@ -665,6 +688,23 @@ int PipelineHandlerRPi::configure(Camera *camera,\n> CameraConfiguration *config)\n>                         return -EINVAL;\n>                 }\n>\n> +               if (cfg.actualColorSpace != format.colorSpace) {\n> +                       /*\n> +                        * We should have been through validate() before\n> so this\n> +                        * shouldn't be possible, but we mustn't sweep\n> color space\n> +                        * problems under the carpet.\n> +                        */\n> +                       LOG(RPI, Warning)\n> +                               << \"Unexpected color space change (\"\n> +                               << cfg.actualColorSpace.toString() << \" to\n> \"\n> +                               << format.colorSpace.toString() << \") in\n> stream \"\n> +                               << stream->name();\n> +                       cfg.actualColorSpace = format.colorSpace;\n> +               }\n> +               LOG(RPI, Debug)\n> +                       << \"Stream \" << stream->name() << \" has color\n> space \"\n> +                       << cfg.actualColorSpace.toString();\n> +\n>                 cfg.setStream(stream);\n>                 stream->setExternal(true);\n>\n> @@ -689,6 +729,8 @@ int PipelineHandlerRPi::configure(Camera *camera,\n> CameraConfiguration *config)\n>                 format = {};\n>                 format.size = maxSize;\n>                 format.fourcc =\n> V4L2PixelFormat::fromPixelFormat(formats::YUV420);\n> +               /* No one asked for output, so the color space doesn't\n> matter. */\n> +               format.colorSpace = ColorSpace::Jpeg;\n>                 ret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n>                 if (ret) {\n>                         LOG(RPI, Error)\n> --\n> 2.20.1\n>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CF72FBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Oct 2021 08:42:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 18C0E64873;\n\tMon, 25 Oct 2021 10:42:28 +0200 (CEST)","from mail-lf1-x132.google.com (mail-lf1-x132.google.com\n\t[IPv6:2a00:1450:4864:20::132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E916C60124\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 10:42:26 +0200 (CEST)","by mail-lf1-x132.google.com with SMTP id x192so9502246lff.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 01:42:26 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ORhlvyh7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=rzioOg8IObPqY89ilne2KEDl4Yd8wdbOTwFf+hisXu4=;\n\tb=ORhlvyh7KpcYvhopuSMe1t1bzzUg6bqNq0YTbyYLOj6uTd/uHiT6+rq1OTJR8CORif\n\tLZNEV2fjD14QhxAwJVVDJ0cV9E3uhk6hdkfCtkcRTYLzo0T1dC//NOeJZQ2Acmm79P5R\n\tzzmq87LRYmCmNBm8iA2FzwFCQFfnwhZzT4WFiJ5/luwPk56dot8G/nZbIt4MDcd+hiwK\n\tyKaj2QV+QY4i1F+ZpoxV0obEC95rtn+trkigJ/0dwVqzQ3zzNvhgfLUdEKABygkzxdKe\n\t9AcO/yBnkBUwprFrtxg9VSkr31uftAmvq72rnuzI6tkt8pX/lGdProWBgvUSf+rEY62Y\n\tLkQA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=rzioOg8IObPqY89ilne2KEDl4Yd8wdbOTwFf+hisXu4=;\n\tb=bzH+zATbK9tgOdLy292w/5h1QOIq+uKhcOVzIOmvIu3PuJ4wWpB3QGgD1SsRFlQhN2\n\t0sVHWvhKTt+7EKR03fK4quGIwoC1+4JYQV6IprzG2+6qVf4khSNVmlYTDClsMOCI2Oxl\n\tiH/RlFS7shgT/PbNZF00A8/KfVRMHUzUROvMiwTlhvVSm9Y7THPNjJm2u7SxC2ScqH0o\n\tYF4KeJ5ELcaAurZnKmWwbkfADgknlucGlcyIEBXybsCD4d8YdjDvrYsqzUIHzjgtg9ET\n\tZu03/ePdufjrVdLyy3NR7y79U7+K6QvZTeiE5MMcqf5pZ6ak2R1qM0owLekcyMCoTV1g\n\tp2yQ==","X-Gm-Message-State":"AOAM532Arr2L6VK5j5fAci1SggE6yb9djB8Opy1oi/XVMwIYpGsF/OPE\n\taFF0wkSvATubqHdWXFqjpvlJ/jdsomiMAG8iPjn8dw==","X-Google-Smtp-Source":"ABdhPJwjzp90pgdh2DoSPoxhDJG2Ixlo+vvWCQvtIHTYMQLLyWu7inLfoLa//dGwQ0bugOOToh1UtX7sAWVHsxWsOEU=","X-Received":"by 2002:a05:6512:2241:: with SMTP id\n\ti1mr15398095lfu.611.1635151346182; \n\tMon, 25 Oct 2021 01:42:26 -0700 (PDT)","MIME-Version":"1.0","References":"<20211020110825.12902-1-david.plowman@raspberrypi.com>\n\t<20211020110825.12902-8-david.plowman@raspberrypi.com>","In-Reply-To":"<20211020110825.12902-8-david.plowman@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 25 Oct 2021 09:42:10 +0100","Message-ID":"<CAEmqJPqnA8mQdm=f3SKcUt2whEbWiD8Lr+W-hKeDuowsCsRmYw@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Content-Type":"multipart/alternative; boundary=\"00000000000024c23a05cf295766\"","Subject":"Re: [libcamera-devel] [PATCH v3 7/7] libcamera: pipeline:\n\traspberrypi: Support color spaces","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20429,"web_url":"https://patchwork.libcamera.org/comment/20429/","msgid":"<CAHW6GYLuoYwDh4Jeb6rRmwQ-Ys2RpLE7eq3jt2+OLK7zE=iFiA@mail.gmail.com>","date":"2021-10-25T09:59:30","subject":"Re: [libcamera-devel] [PATCH v3 7/7] libcamera: pipeline:\n\traspberrypi: Support color spaces","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the reply!\n\nOn Mon, 25 Oct 2021 at 09:42, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> Hi David,\n>\n> Thank you for your patch.\n>\n> On Wed, 20 Oct 2021 at 12:08, David Plowman <david.plowman@raspberrypi.com> wrote:\n>>\n>> The Raspberry Pi pipeline handler now sets color spaces correctly.\n>>\n>> In generateConfiguration() it sets them to reasonable default values\n>> based on the stream role.\n>>\n>> validate() now calls validateColorSpaces() to ensure that the\n>> requested color spaces are sensible, before proceeding to check what\n>> the hardware can deliver.\n>>\n>> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n>> ---\n>>  .../pipeline/raspberrypi/raspberrypi.cpp      | 42 +++++++++++++++++++\n>>  1 file changed, 42 insertions(+)\n>>\n>> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n>> index 1634ca98..22db54ce 100644\n>> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n>> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n>> @@ -288,6 +288,8 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>>         if (config_.empty())\n>>                 return Invalid;\n>>\n>> +       status = validateColorSpaces(true);\n>> +\n>>         /*\n>>          * What if the platform has a non-90 degree rotation? We can't even\n>>          * \"adjust\" the configuration and carry on. Alternatively, raising an\n>> @@ -354,6 +356,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>>                          */\n>>                         V4L2VideoDevice::Formats fmts = data_->unicam_[Unicam::Image].dev()->formats();\n>>                         V4L2DeviceFormat sensorFormat = findBestMode(fmts, cfg.size);\n>> +                       sensorFormat.colorSpace = ColorSpace::Raw;\n>\n>\n> This is going to conflict badly with my media controller changes ;-)\n\n*sigh* yes I know :(\n\nBut on the plus side, there aren't that many changes here, and some of\nit may actually get tidier (setting the sensor colour space explicitly\nto \"raw\", for example, should just disappear, right?).\n\nBest regards\n\nDavid\n\n>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n>\n>>\n>>                         int ret = data_->unicam_[Unicam::Image].dev()->tryFormat(&sensorFormat);\n>>                         if (ret)\n>>                                 return Invalid;\n>> @@ -449,10 +452,21 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>>                 V4L2DeviceFormat format;\n>>                 format.fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>>                 format.size = cfg.size;\n>> +               format.colorSpace = cfg.requestedColorSpace;\n>> +               LOG(RPI, Debug)\n>> +                       << \"Try color space \" << cfg.requestedColorSpace.toString();\n>>\n>>                 int ret = dev->tryFormat(&format);\n>>                 if (ret)\n>>                         return Invalid;\n>> +               cfg.actualColorSpace = format.colorSpace;\n>> +               if (cfg.actualColorSpace != cfg.requestedColorSpace) {\n>> +                       status = Adjusted;\n>> +                       LOG(RPI, Warning)\n>> +                               << \"Color space changed from \"\n>> +                               << cfg.requestedColorSpace.toString() << \" to \"\n>> +                               << cfg.actualColorSpace.toString();\n>> +               }\n>>\n>>                 cfg.stride = format.planes[0].bpl;\n>>                 cfg.frameSize = format.planes[0].size;\n>> @@ -477,6 +491,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>>         PixelFormat pixelFormat;\n>>         V4L2VideoDevice::Formats fmts;\n>>         Size size;\n>> +       ColorSpace colorSpace;\n>>\n>>         if (roles.empty())\n>>                 return config;\n>> @@ -491,6 +506,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>>                         sensorFormat = findBestMode(fmts, size);\n>>                         pixelFormat = sensorFormat.fourcc.toPixelFormat();\n>>                         ASSERT(pixelFormat.isValid());\n>> +                       colorSpace = ColorSpace::Raw;\n>>                         bufferCount = 2;\n>>                         rawCount++;\n>>                         break;\n>> @@ -498,6 +514,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>>                 case StreamRole::StillCapture:\n>>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>>                         pixelFormat = formats::NV12;\n>> +                       colorSpace = ColorSpace::Jpeg;\n>>                         /* Return the largest sensor resolution. */\n>>                         size = data->sensor_->resolution();\n>>                         bufferCount = 1;\n>> @@ -515,6 +532,8 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>>                          */\n>>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>>                         pixelFormat = formats::YUV420;\n>> +                       /* This will be reasonable for many applications. */\n>> +                       colorSpace = ColorSpace::Rec709;\n>>                         size = { 1920, 1080 };\n>>                         bufferCount = 4;\n>>                         outCount++;\n>> @@ -523,6 +542,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>>                 case StreamRole::Viewfinder:\n>>                         fmts = data->isp_[Isp::Output0].dev()->formats();\n>>                         pixelFormat = formats::ARGB8888;\n>> +                       colorSpace = ColorSpace::Jpeg;\n>>                         size = { 800, 600 };\n>>                         bufferCount = 4;\n>>                         outCount++;\n>> @@ -554,6 +574,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n>>                 StreamConfiguration cfg(formats);\n>>                 cfg.size = size;\n>>                 cfg.pixelFormat = pixelFormat;\n>> +               cfg.requestedColorSpace = colorSpace;\n>>                 cfg.bufferCount = bufferCount;\n>>                 config->addConfiguration(cfg);\n>>         }\n>> @@ -601,6 +622,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>>         /* First calculate the best sensor mode we can use based on the user request. */\n>>         V4L2VideoDevice::Formats fmts = data->unicam_[Unicam::Image].dev()->formats();\n>>         V4L2DeviceFormat sensorFormat = findBestMode(fmts, rawStream ? sensorSize : maxSize);\n>> +       sensorFormat.colorSpace = ColorSpace::Raw;\n>>\n>>         /*\n>>          * Unicam image output format. The ISP input format gets set at start,\n>> @@ -650,6 +672,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>>                 V4L2PixelFormat fourcc = V4L2PixelFormat::fromPixelFormat(cfg.pixelFormat);\n>>                 format.size = cfg.size;\n>>                 format.fourcc = fourcc;\n>> +               format.colorSpace = cfg.requestedColorSpace;\n>>\n>>                 LOG(RPI, Debug) << \"Setting \" << stream->name() << \" to \"\n>>                                 << format.toString();\n>> @@ -665,6 +688,23 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>>                         return -EINVAL;\n>>                 }\n>>\n>> +               if (cfg.actualColorSpace != format.colorSpace) {\n>> +                       /*\n>> +                        * We should have been through validate() before so this\n>> +                        * shouldn't be possible, but we mustn't sweep color space\n>> +                        * problems under the carpet.\n>> +                        */\n>> +                       LOG(RPI, Warning)\n>> +                               << \"Unexpected color space change (\"\n>> +                               << cfg.actualColorSpace.toString() << \" to \"\n>> +                               << format.colorSpace.toString() << \") in stream \"\n>> +                               << stream->name();\n>> +                       cfg.actualColorSpace = format.colorSpace;\n>> +               }\n>> +               LOG(RPI, Debug)\n>> +                       << \"Stream \" << stream->name() << \" has color space \"\n>> +                       << cfg.actualColorSpace.toString();\n>> +\n>>                 cfg.setStream(stream);\n>>                 stream->setExternal(true);\n>>\n>> @@ -689,6 +729,8 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n>>                 format = {};\n>>                 format.size = maxSize;\n>>                 format.fourcc = V4L2PixelFormat::fromPixelFormat(formats::YUV420);\n>> +               /* No one asked for output, so the color space doesn't matter. */\n>> +               format.colorSpace = ColorSpace::Jpeg;\n>>                 ret = data->isp_[Isp::Output0].dev()->setFormat(&format);\n>>                 if (ret) {\n>>                         LOG(RPI, Error)\n>> --\n>> 2.20.1\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 161D0BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Oct 2021 09:59:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9FF3964871;\n\tMon, 25 Oct 2021 11:59:43 +0200 (CEST)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F38B86486E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 11:59:41 +0200 (CEST)","by mail-wr1-x42e.google.com with SMTP id u18so8383920wrg.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Oct 2021 02:59:41 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"LU3phlOW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=6+cF/2FxtQYQhjDMT2QgR1xjt7DQW+cQ0RSY/J4x0gs=;\n\tb=LU3phlOWYxtKcUlFgpqCd+QbNLxJ/mp5fcVlcSkEIxXsea49ShoR8fc8EsWQCtnqK/\n\t6sSaQ9Q3A2hvsRfiY/GT/Z4bmNaqtkXjwaClV65wCWFkvbk4EetCpd5NMMLl+l5xlEO5\n\tsaCY4Mu1JJeZMUl7VCXWpk1xM0Je4M7tp7OCzk1hqR6PIujyl6etDltQ96oDr1LT/FKD\n\tNmxJhKgFqXLKNzFOmEhQrn+e8oA/zhoh/ocbofZof9uSW6TinGLdWBUJON1ESn6ioGb8\n\tiCdvHSJBjeL8HfGBILCyc+wo+mYffalDHyd6NYSRsm6NtpPqv5iThuV7E0pAHfajCl9U\n\tziJg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=6+cF/2FxtQYQhjDMT2QgR1xjt7DQW+cQ0RSY/J4x0gs=;\n\tb=aVuK577U9GVxmhYc6VYonWljOJz010G45jZpoRZx2E+aDsW6sfjqWJUhNCCjgfsKn/\n\tAB6XDgxLzdABja7CJL/hoOLOVSKXr6mC58PiSk+VOFcsjhEDpfwpL3s/aktp+rasd1R8\n\t+qxy4bf0y8cQ471kRfCDZ76DVhKZJy/m7/iOFUquea5xINgub29wRe3QM7FGcYDyWk6J\n\tkDdleBVd/FQ8MThK3JY2uTobWAZP5oit45pydRikuUzuVO5QlOQm0Gn4YqjNn6Kb5BlQ\n\t8GFfK4YRycpnkjtuVS+LFIbPu6qgmw5M4q9o6Bz5eC25d6g9g6DHevC1S/goO3koMMbb\n\ttkXA==","X-Gm-Message-State":"AOAM530NwOQKnwW6HzShLHY772KjEKHL/hqu1Wr19//6ZHYhuv2oK01v\n\tdst8RjGzDDHKcHx/BZoEmxBZd8rZlDpsivctpNT5bL5p","X-Google-Smtp-Source":"ABdhPJy3xZjas3RaxgkLItwmJ+XidluY+L/heAZfzQbdLaZ3+R3YmpmFD+hiVuWKegLUzEWFNWG0cfDxwxk58h+av1c=","X-Received":"by 2002:adf:a402:: with SMTP id\n\td2mr23239012wra.266.1635155981693; \n\tMon, 25 Oct 2021 02:59:41 -0700 (PDT)","MIME-Version":"1.0","References":"<20211020110825.12902-1-david.plowman@raspberrypi.com>\n\t<20211020110825.12902-8-david.plowman@raspberrypi.com>\n\t<CAEmqJPqnA8mQdm=f3SKcUt2whEbWiD8Lr+W-hKeDuowsCsRmYw@mail.gmail.com>","In-Reply-To":"<CAEmqJPqnA8mQdm=f3SKcUt2whEbWiD8Lr+W-hKeDuowsCsRmYw@mail.gmail.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Mon, 25 Oct 2021 10:59:30 +0100","Message-ID":"<CAHW6GYLuoYwDh4Jeb6rRmwQ-Ys2RpLE7eq3jt2+OLK7zE=iFiA@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v3 7/7] libcamera: pipeline:\n\traspberrypi: Support color spaces","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]