{"id":19552,"url":"https://patchwork.libcamera.org/api/patches/19552/?format=json","web_url":"https://patchwork.libcamera.org/patch/19552/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20240227140953.26093-2-laurent.pinchart@ideasonboard.com>","date":"2024-02-27T14:09:45","name":"[1/9] libcamera: v4l2_subdevice: Rename V4L2SubdeviceFormatInfo","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f59cd4ea5e2190aff063b3de9ff7f99547100eda","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19552/mbox/","series":[{"id":4189,"url":"https://patchwork.libcamera.org/api/series/4189/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4189","date":"2024-02-27T14:09:44","name":"libcamera: v4l2_subdevice: Prepare for embedded data support","version":1,"mbox":"https://patchwork.libcamera.org/series/4189/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19552/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19552/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 BBF92C3264\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Feb 2024 14:09:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 121A262874;\n\tTue, 27 Feb 2024 15:09:54 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 72ABD6285F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Feb 2024 15:09:52 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 44DCB8C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Feb 2024 15:09:40 +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=\"PhobCoFj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709042980;\n\tbh=T4RMboJoRmx3BYmGUpKuYn+EK3XdhJKOoSpCN0QYraQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=PhobCoFjmdksYnlcx8SMXi+GL/UGnN+uPyCattqNehi2OLx58CDr+Cy+cDPsdTpXE\n\tAo8tkiDj2702r9vKSI5cmpsyKr/QFCTX6DWjjaNm+JvLnRpkuZN/v2RUcHr1OsQYRz\n\t26HLHtIDzNd75f8ccvsG/Oir9qIWINQsNr3uKq44=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH 1/9] libcamera: v4l2_subdevice: Rename\n\tV4L2SubdeviceFormatInfo","Date":"Tue, 27 Feb 2024 16:09:45 +0200","Message-ID":"<20240227140953.26093-2-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>","References":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"The V4L2SubdeviceFormatInfo structure contains information about a media\nbus format, not a V4L2 subdevice format. Rename it to MediaBusFormatInfo\nto clarify its purpose. Rename the formatInfoMap map accordingly.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_subdevice.cpp | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)","diff":"diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 6d0785b7b484..6c1df7812f07 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -39,24 +39,24 @@ LOG_DECLARE_CATEGORY(V4L2)\n namespace {\n \n /*\n- * \\struct V4L2SubdeviceFormatInfo\n+ * \\struct MediaBusFormatInfo\n  * \\brief Information about media bus formats\n  * \\param bitsPerPixel Bits per pixel\n  * \\param name Name of MBUS format\n  * \\param colourEncoding Type of colour encoding\n  */\n-struct V4L2SubdeviceFormatInfo {\n+struct MediaBusFormatInfo {\n \tunsigned int bitsPerPixel;\n \tconst char *name;\n \tPixelFormatInfo::ColourEncoding colourEncoding;\n };\n \n /*\n- * \\var formatInfoMap\n- * \\brief A map that associates V4L2SubdeviceFormatInfo struct to V4L2 media\n+ * \\var mediaBusFormatInfo\n+ * \\brief A map that associates MediaBusFormatInfo struct to V4L2 media\n  * bus codes\n  */\n-const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {\n+const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo = {\n \t/* This table is sorted to match the order in linux/media-bus-format.h */\n \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, \"RGB444_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n \t{ MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, \"RGB444_2X8_PADHI_LE\", PixelFormatInfo::ColourEncodingRGB } },\n@@ -237,8 +237,8 @@ const std::string V4L2SubdeviceFormat::toString() const\n  */\n uint8_t V4L2SubdeviceFormat::bitsPerPixel() const\n {\n-\tconst auto it = formatInfoMap.find(mbus_code);\n-\tif (it == formatInfoMap.end()) {\n+\tconst auto it = mediaBusFormatInfo.find(mbus_code);\n+\tif (it == mediaBusFormatInfo.end()) {\n \t\tLOG(V4L2, Error) << \"No information available for format '\"\n \t\t\t\t << *this << \"'\";\n \t\treturn 0;\n@@ -258,9 +258,9 @@ std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f)\n {\n \tout << f.size << \"-\";\n \n-\tconst auto it = formatInfoMap.find(f.mbus_code);\n+\tconst auto it = mediaBusFormatInfo.find(f.mbus_code);\n \n-\tif (it == formatInfoMap.end())\n+\tif (it == mediaBusFormatInfo.end())\n \t\tout << utils::hex(f.mbus_code, 4);\n \telse\n \t\tout << it->second.name;\n@@ -511,8 +511,8 @@ std::optional<ColorSpace> V4L2Subdevice::toColorSpace(const v4l2_mbus_framefmt &\n \t\treturn std::nullopt;\n \n \tPixelFormatInfo::ColourEncoding colourEncoding;\n-\tauto iter = formatInfoMap.find(format.code);\n-\tif (iter != formatInfoMap.end()) {\n+\tauto iter = mediaBusFormatInfo.find(format.code);\n+\tif (iter != mediaBusFormatInfo.end()) {\n \t\tcolourEncoding = iter->second.colourEncoding;\n \t} else {\n \t\tLOG(V4L2, Warning)\n","prefixes":["1/9"]}