{"id":15106,"url":"https://patchwork.libcamera.org/api/1.1/patches/15106/?format=json","web_url":"https://patchwork.libcamera.org/patch/15106/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211210112142.18441-3-david.plowman@raspberrypi.com>","date":"2021-12-10T11:21:36","name":"[libcamera-devel,v11,2/8] libcamera: stream: Add ColorSpace fields to StreamConfiguration","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"cf78a336651f15c101dcc5162976fbd2fd6de722","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/1.1/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15106/mbox/","series":[{"id":2834,"url":"https://patchwork.libcamera.org/api/1.1/series/2834/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2834","date":"2021-12-10T11:21:34","name":"Colour spaces","version":11,"mbox":"https://patchwork.libcamera.org/series/2834/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15106/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15106/checks/","tags":{},"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 58F33C324B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Dec 2021 11:22:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 217DD60894;\n\tFri, 10 Dec 2021 12:22:08 +0100 (CET)","from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A40816088E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Dec 2021 12:22:04 +0100 (CET)","by mail-wr1-x434.google.com with SMTP id d9so14376782wrw.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Dec 2021 03:22:04 -0800 (PST)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tz18sm2198469wrq.11.2021.12.10.03.22.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 10 Dec 2021 03:22:04 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"GKeGqEeu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=+sH0KfN2WD6NxZb8aJTKXBPu6mnk13ViaZCwPQX529M=;\n\tb=GKeGqEeu4r02zZYe5dsi5gaBXsyflqlPT6c3PFmdPpsvn0t7edGGvJ4k1E6q0SqtGo\n\tSEfKaVE13RjjQ4d2J9CidSx0XdzXEiQcbyu4XvOtZEHM4numObiVsRmwIKzWPE8F3EeU\n\tGj32dIHu0a2tnCBwwIIOeRt5cepho2UC8rTVfMW4KyUcrGbDC3jOjQaZhyw06VVfFpW8\n\tvB0LKnv0OyFWd5OcDfsnMrlJMAwUWyJd0TMwg/5UtA4q6vT5EZJ8dwExio+R8z2KBYtl\n\tTvwrX+Ywkc/gpX+aY0ZkbWafDz1jjvN2SMQqXyN5LgVEqJ9KYBHgI+JJsYHNIrUfuwm0\n\tolxA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=+sH0KfN2WD6NxZb8aJTKXBPu6mnk13ViaZCwPQX529M=;\n\tb=uU3cwSpYxcbXiT1RQ34Ope0qaMLUbS0lKfbVv5XcaiGGGYGRedda9xNjm12krz4BOe\n\ttHTfNc71kLP0BohpHbUqfZeROJK/l3lepKSfRtucRJZB/hirKnaHliWALJTX+TlDIMWb\n\tmCxbMnF1u+UBuDW/b/+0HCWk+hXnU+0QErYQKIIR+xeLEYvZjE1BBLgo1FYGLJfhrsBH\n\tpHTEao2mPYKJvWPZOoI3Poc+RUmK0wA2qGYbhuAOBH3VOpeSQqoZ79ZaZB9Op/X5tggf\n\tR0Ooymg/8lgvexD9sQfYc9lLKzpb4IbbSOcypWH/r8cg4tX13DJ/BbHAKHPKMrY4ip3s\n\tSMKg==","X-Gm-Message-State":"AOAM530VKMuXOTlY6f6j3YbxNLREHETChiGU6vOQ4E3Q2+q/pQChG6rH\n\tKvTO6dNlfg9L+KOmJHqiKafAMg==","X-Google-Smtp-Source":"ABdhPJwvBEEYMiXgG9+OlHk3xvU1ggacccQlXfAA7WCNZrOvCALYHzNWwoHT3DrVN5WMS59kwm8fcQ==","X-Received":"by 2002:a05:6000:1862:: with SMTP id\n\td2mr13608868wri.251.1639135324306; \n\tFri, 10 Dec 2021 03:22:04 -0800 (PST)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHans Verkuil <hverkuil-cisco@xs4all.nl>, Tomasz Figa <tfiga@google.com>, \n\tJacopo Mondi <jacopo@jmondi.org>,\n\tNaushir Patuck <naush@raspberrypi.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 10 Dec 2021 11:21:36 +0000","Message-Id":"<20211210112142.18441-3-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","In-Reply-To":"<20211210112142.18441-1-david.plowman@raspberrypi.com>","References":"<20211210112142.18441-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v11 2/8] libcamera: stream: Add ColorSpace\n\tfields to StreamConfiguration","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"This is so that applications can choose appropriate color spaces which\nwill then be passed down to the V4L2 devices.\n\nThe ColorSpace field is actually optional. If it is not set you will\nget the camera's default color space.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/stream.h |  3 +++\n src/libcamera/stream.cpp   | 20 ++++++++++++++++++++\n 2 files changed, 23 insertions(+)","diff":"diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 41ec02b1..f0ae7e62 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -12,6 +12,7 @@\n #include <string>\n #include <vector>\n \n+#include <libcamera/color_space.h>\n #include <libcamera/framebuffer.h>\n #include <libcamera/geometry.h>\n #include <libcamera/pixel_format.h>\n@@ -47,6 +48,8 @@ struct StreamConfiguration {\n \n \tunsigned int bufferCount;\n \n+\tstd::optional<ColorSpace> colorSpace;\n+\n \tStream *stream() const { return stream_; }\n \tvoid setStream(Stream *stream) { stream_ = stream; }\n \tconst StreamFormats &formats() const { return formats_; }\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex b421e17e..686e693b 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -329,6 +329,26 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n  * \\brief Requested number of buffers to allocate for the stream\n  */\n \n+/**\n+ * \\var StreamConfiguration::colorSpace\n+ * \\brief The ColorSpace for this stream\n+ *\n+ * This field allows a ColorSpace to be selected for this Stream.\n+ *\n+ * The field is optional and an application can choose to leave it unset.\n+ * Platforms that support the use of color spaces may provide default\n+ * values through the generateConfiguration() method. An application can\n+ * override these when necessary.\n+ *\n+ * If a specific ColorSpace is requested but the Camera cannot deliver it,\n+ * then the StreamConfiguration will be adjusted to a value that can be\n+ * delivered. In this case the validate() method will indicate via its\n+ * return value that the CameraConfiguration has been adjusted.\n+ *\n+ * Note that platforms will typically have different constraints on what\n+ * color spaces can be supported and in what combinations.\n+ */\n+\n /**\n  * \\fn StreamConfiguration::stream()\n  * \\brief Retrieve the stream associated with the configuration\n","prefixes":["libcamera-devel","v11","2/8"]}