{"id":16951,"url":"https://patchwork.libcamera.org/api/1.1/patches/16951/?format=json","web_url":"https://patchwork.libcamera.org/patch/16951/","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":"<20220803112640.30402-7-jacopo@jmondi.org>","date":"2022-08-03T11:26:38","name":"[libcamera-devel,v6,6/8] libcamera: v4l2_pixelformat: Implement std::hash specialization","commit_ref":"29c09e3ab6c18c649d8510a1faee6c5a2b52c04a","pull_url":null,"state":"accepted","archived":false,"hash":"dce8756322000d47e44dc5d4034274ce70810b5a","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16951/mbox/","series":[{"id":3368,"url":"https://patchwork.libcamera.org/api/1.1/series/3368/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3368","date":"2022-08-03T11:26:32","name":"libcamera: Map multiple V4L2 formats to a single libcamera::format","version":6,"mbox":"https://patchwork.libcamera.org/series/3368/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16951/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16951/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 C5BD9C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Aug 2022 11:27:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 841C163318;\n\tWed,  3 Aug 2022 13:27:07 +0200 (CEST)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 53CD36330F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Aug 2022 13:27:06 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 694CD1BF20E;\n\tWed,  3 Aug 2022 11:27:04 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659526027;\n\tbh=bSAXK1NRAX8/nIJWw3M3lAu+FFY1N101Ct9jJTzI8IQ=;\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:Cc:\n\tFrom;\n\tb=1VIpY2WO0+b0lfYKDkeGXSTah+aP4XeGHV3TUr4nrUwOqSV/9q2Hotcl3TpipWTzH\n\t1/Riy2qRzGVP4Izx0INBG6FFCw7I1HVdZN++uV5gXHvDGRUDjl2Qf8kOI4vPufBpd1\n\t9LqUSpn59wzPErcAI4ybgqgmrYEX5jwybmFN6258TCGd+yg1pj2YyyolqfJxltZfO9\n\twyXVtXhFtgK4MxLwLR8KalRFYZOHdbxMf0UHw5VuibosHICp/v2tpnIrK9FRLfPYQ0\n\t2BnLkNdBSrL+0c62mQGQxuhxuKiyne/NDS+WICabvwOQN/lYptR4hMU4yhpWlFf1bX\n\tELb/H9IO8b2oA==","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  3 Aug 2022 13:26:38 +0200","Message-Id":"<20220803112640.30402-7-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.37.1","In-Reply-To":"<20220803112640.30402-1-jacopo@jmondi.org>","References":"<20220803112640.30402-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 6/8] libcamera: v4l2_pixelformat:\n\tImplement std::hash specialization","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"jozef@mlich.cz, Pavel Machek <pavel@ucw.cz>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nInject a specialization of std::hash<> for the V4L2PixelFormat class in\nthe std namespace to make it possible to store instances of the class in\nthe std::unordered_map and std::unordered_set containers.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/internal/v4l2_pixelformat.h | 13 +++++++++++++\n 1 file changed, 13 insertions(+)","diff":"diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h\nindex d5400f90a67e..34d283db44f4 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 <functional>\n #include <ostream>\n #include <stdint.h>\n #include <string>\n@@ -55,3 +56,15 @@ private:\n std::ostream &operator<<(std::ostream &out, const V4L2PixelFormat &f);\n \n } /* namespace libcamera */\n+\n+namespace std {\n+\n+template<>\n+struct hash<libcamera::V4L2PixelFormat> {\n+\tsize_t operator()(libcamera::V4L2PixelFormat const &format) const noexcept\n+\t{\n+\t\treturn format.fourcc();\n+\t}\n+};\n+\n+} /* namespace std */\n","prefixes":["libcamera-devel","v6","6/8"]}