[{"id":21633,"web_url":"https://patchwork.libcamera.org/comment/21633/","msgid":"<Ya9jP9d3586nuSzv@pendragon.ideasonboard.com>","date":"2021-12-07T13:35:59","subject":"Re: [libcamera-devel] [PATCH v9 2/8] libcamera: Add ColorSpace\n\tfields to StreamConfiguration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nThe subject line should read\n\nlibcamera: stream: Add ColorSpace fields to StreamConfiguration\n\nOn Mon, Dec 06, 2021 at 10:50:25AM +0000, David Plowman wrote:\n> This is so that applications can choose appropriate color spaces which\n> will then be passed down to the V4L2 devices.\n> \n> The ColorSpace field is actually optional. If it is not set you will\n> get the driver's default color space.\n\ns/driver/camera/ (from the point of view of the application, it doesn't\nmatter if the default comes from the driver or the pipeline handler)\n\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/stream.h |  3 +++\n>  src/libcamera/stream.cpp   | 20 ++++++++++++++++++++\n>  2 files changed, 23 insertions(+)\n> \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 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_; }\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 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","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 53E9DBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Dec 2021 13:36:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ABF8D605C4;\n\tTue,  7 Dec 2021 14:36:30 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A732160592\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Dec 2021 14:36:28 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B11B3556;\n\tTue,  7 Dec 2021 14:36:27 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"K2/YqZhm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638884187;\n\tbh=1ft29656rF7HcD7599NlC55K2jEXsZ8SV47cGLjd2oM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=K2/YqZhmam3ifW9PaMIpy3iZoBJTVaqB2i6N5SakKFfZvuJuQvu3IsoSXEZuPcZ3i\n\tMREEA+QKH/V+RB8epke+UeBGYUmG78+XJL+vQZzEh5sYtgKb1JiqZH9MbZsSFGgtbd\n\tZteunY8KcC7i38GM1pU1bOhN93Qrlx5WxhT1NQVk=","Date":"Tue, 7 Dec 2021 15:35:59 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<Ya9jP9d3586nuSzv@pendragon.ideasonboard.com>","References":"<20211206105032.13876-1-david.plowman@raspberrypi.com>\n\t<20211206105032.13876-3-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211206105032.13876-3-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v9 2/8] libcamera: 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>","Cc":"tfiga@google.com, libcamera-devel@lists.libcamera.org,\n\thverkuil-cisco@xs4all.nl","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]