{"id":15756,"url":"https://patchwork.libcamera.org/api/1.1/patches/15756/?format=json","web_url":"https://patchwork.libcamera.org/patch/15756/","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":"<20220429212348.18063-3-laurent.pinchart@ideasonboard.com>","date":"2022-04-29T21:23:45","name":"[libcamera-devel,2/5] libcamera: Add operator<<() for pixel format classes","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"2550ef3e31275097baa8d1d39285b6aa98c0f6f8","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15756/mbox/","series":[{"id":3084,"url":"https://patchwork.libcamera.org/api/1.1/series/3084/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3084","date":"2022-04-29T21:23:43","name":"libcamera: More operator<<() for stream output","version":1,"mbox":"https://patchwork.libcamera.org/series/3084/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15756/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15756/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 C10FCC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Apr 2022 21:23:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CED0965649;\n\tFri, 29 Apr 2022 23:23:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AEDD86042F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Apr 2022 23:23:53 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 424AD488;\n\tFri, 29 Apr 2022 23:23:53 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651267436;\n\tbh=c/W7P84n+bFDmMYUyU2IKL/TCgna5QVZsUa6c8/xcJg=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=yjyZtLYHzXEM1qrRVnQ5LphEXOYqzH1tlvcT9zQjEuBfZ9XxC0t8X4EyJiGjJK8GT\n\tCXlR7qyNn6MtFICiV5uBCJw6UbPMIv1Tet/3LTULlYA/w8mxb337RE3kNaiSJt9sHP\n\tV2iTo0FWJLulJiqtUVwRbYhfgUL6bYCJynQ9B047Yx3XSxwJc0jzuvPFeUPoEKoa/t\n\t2KxekzxkwETu1YMAFXXn9JtPpdNj/QmW7Svj3hGhzVQiXJI49HOaNPS8qY8eRuWBvd\n\tvQfAORDeeO5rDRGWThWW7g2S9cJJVjjFPc1DFbgouAtrVjtf3QTk0tQrEDx1qc+F0E\n\tGL2VcMdQ3wGfg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1651267433;\n\tbh=c/W7P84n+bFDmMYUyU2IKL/TCgna5QVZsUa6c8/xcJg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=aFA2jJfgIE3PPGNTVhFcZl18Hz9y+aXMVTQW9FjLnj33V5Sr/BdP+RZ4YhQtCDU5E\n\tlv5438yL1nRRw14sEG0f/TYlLX32i6/Or3H2hLKdED4c1x900bYEESvc0CbKu+T3gI\n\tzVnyMIZ2HCHkZgMGboeU0jITwRkAwdD4MU2o9raE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"aFA2jJfg\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 30 Apr 2022 00:23:45 +0300","Message-Id":"<20220429212348.18063-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>","References":"<20220429212348.18063-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/5] libcamera: Add operator<<() for pixel\n\tformat classes","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Implement the stream output operator<<() for the PixelFormat and\nV4L2PixelFormat classes to simplify printing them.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/v4l2_pixelformat.h |  3 +++\n include/libcamera/pixel_format.h              |  3 +++\n src/libcamera/pixel_format.cpp                | 12 ++++++++++++\n src/libcamera/v4l2_pixelformat.cpp            | 13 +++++++++++++\n 4 files changed, 31 insertions(+)","diff":"diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h\nindex 886d534d8c91..fb2d5d0b93df 100644\n--- a/include/libcamera/internal/v4l2_pixelformat.h\n+++ b/include/libcamera/internal/v4l2_pixelformat.h\n@@ -8,6 +8,7 @@\n \n #pragma once\n \n+#include <ostream>\n #include <stdint.h>\n #include <string>\n \n@@ -50,4 +51,6 @@ private:\n \tuint32_t fourcc_;\n };\n \n+std::ostream &operator<<(std::ostream &out, const V4L2PixelFormat &f);\n+\n } /* namespace libcamera */\ndiff --git a/include/libcamera/pixel_format.h b/include/libcamera/pixel_format.h\nindex a9d7c03de851..d49c5f784118 100644\n--- a/include/libcamera/pixel_format.h\n+++ b/include/libcamera/pixel_format.h\n@@ -7,6 +7,7 @@\n \n #pragma once\n \n+#include <ostream>\n #include <set>\n #include <stdint.h>\n #include <string>\n@@ -45,4 +46,6 @@ private:\n \tuint64_t modifier_;\n };\n \n+std::ostream &operator<<(std::ostream &out, const PixelFormat &f);\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/pixel_format.cpp b/src/libcamera/pixel_format.cpp\nindex 997aeb8a9290..80c22072b072 100644\n--- a/src/libcamera/pixel_format.cpp\n+++ b/src/libcamera/pixel_format.cpp\n@@ -140,4 +140,16 @@ PixelFormat PixelFormat::fromString(const std::string &name)\n \treturn PixelFormatInfo::info(name).format;\n }\n \n+/**\n+ * \\brief Insert a text representation of a PixelFormat into an output stream\n+ * \\param[in] out The output stream\n+ * \\param[in] f The PixelFormat\n+ * \\return The output stream \\a out\n+ */\n+std::ostream &operator<<(std::ostream &out, const PixelFormat &f)\n+{\n+\tout << f.toString();\n+\treturn out;\n+}\n+\n } /* namespace libcamera */\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex 0e0da3f0df07..1dd93baa7a64 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -316,4 +316,17 @@ V4L2PixelFormat V4L2PixelFormat::fromPixelFormat(const PixelFormat &pixelFormat,\n \treturn multiplanar ? info.v4l2Formats.multi : info.v4l2Formats.single;\n }\n \n+/**\n+ * \\brief Insert a text representation of a V4L2PixelFormat into an output\n+ * stream\n+ * \\param[in] out The output stream\n+ * \\param[in] f The V4L2PixelFormat\n+ * \\return The output stream \\a out\n+ */\n+std::ostream &operator<<(std::ostream &out, const V4L2PixelFormat &f)\n+{\n+\tout << f.toString();\n+\treturn out;\n+}\n+\n } /* namespace libcamera */\n","prefixes":["libcamera-devel","2/5"]}