[{"id":32684,"web_url":"https://patchwork.libcamera.org/comment/32684/","msgid":"<m5qjuyojeeplbabwli3qv5mpqxneqvvsyq5jgmygdceptk3thu@66722ibhyelb>","date":"2024-12-11T16:59:05","subject":"Re: [PATCH v3 10/17] libcamera: stream: Add\n\toperator<<(StreamConfiguration)","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch. \n\nAs it is already on mainline, no need to review it again...\n\nBest regards,\nStefan\n\nOn Fri, Dec 06, 2024 at 11:13:32AM +0100, Stefan Klug wrote:\n> From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> The StreamConfiguration class only implmenets toString() but doesn't\n> offer an overload of operator<<() which is convenient to use.\n> \n> Add an overload for operator<<(StreamConfiguration) which is based on\n> the usage of StreamConfiguration::toString().\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  include/libcamera/stream.h |  2 ++\n>  src/libcamera/stream.cpp   | 13 +++++++++++++\n>  2 files changed, 15 insertions(+)\n> \n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 071b71698acb..ea228aea7d56 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -61,6 +61,8 @@ private:\n>  \tStreamFormats formats_;\n>  };\n>  \n> +std::ostream &operator<<(std::ostream &out, StreamConfiguration cfg);\n> +\n>  enum class StreamRole {\n>  \tRaw,\n>  \tStillCapture,\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 1f75dbbc5b64..a093abf48c7c 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -395,6 +395,19 @@ std::string StreamConfiguration::toString() const\n>  \treturn size.toString() + \"-\" + pixelFormat.toString();\n>  }\n>  \n> +/**\n> + * \\brief Insert a text representation of a StreamConfiguration into an output\n> + * stream\n> + * \\param[in] out The output stream\n> + * \\param[in] cfg The StreamConfiguration\n> + * \\return The output stream \\a out\n> + */\n> +std::ostream &operator<<(std::ostream &out, StreamConfiguration cfg)\n> +{\n> +\tout << cfg.toString();\n> +\treturn out;\n> +}\n> +\n>  /**\n>   * \\enum StreamRole\n>   * \\brief Identify the role a stream is intended to play\n> -- \n> 2.43.0\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 ABFD3C32DD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Dec 2024 16:59:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DFE5C67EBD;\n\tWed, 11 Dec 2024 17:59:09 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2151618AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Dec 2024 17:59:08 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:af9:9d8e:d17e:723])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 93DF521C;\n\tWed, 11 Dec 2024 17:58:35 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ur1IJLir\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733936315;\n\tbh=0COSQMHPCskrI3HMc7BK73sqjZ+lnw4fVmEytdtNp0g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ur1IJLireNuY/hUtdt2FVPhg9pwMiyVXyN8Fh8SETfzywNzwg86/Wj4Bd2OfGvnI3\n\t2Z6P1T9foa4tZjZBdi4qPEtvSHn9L/Y2tc7Ow5P67LOIG56r9WNS856V85WygYMMLw\n\t6AxBBOMt1mK8ujC4/F9W15HaLwILv44BRk9HiQ6M=","Date":"Wed, 11 Dec 2024 17:59:05 +0100","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH v3 10/17] libcamera: stream: Add\n\toperator<<(StreamConfiguration)","Message-ID":"<m5qjuyojeeplbabwli3qv5mpqxneqvvsyq5jgmygdceptk3thu@66722ibhyelb>","References":"<20241206101344.767170-1-stefan.klug@ideasonboard.com>\n\t<20241206101344.767170-11-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241206101344.767170-11-stefan.klug@ideasonboard.com>","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>"}}]