[{"id":28967,"web_url":"https://patchwork.libcamera.org/comment/28967/","msgid":"<171046219506.1913896.9951336341136877990@ping.linuxembedded.co.uk>","date":"2024-03-15T00:23:15","subject":"Re: [PATCH v2 01/14] libcamera: v4l2_subdevice: Rename\n\tV4L2SubdeviceFormatInfo","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-03-15 00:16:00)\n> The V4L2SubdeviceFormatInfo structure contains information about a media\n> bus format, not a V4L2 subdevice format. Rename it to MediaBusFormatInfo\n> to clarify its purpose. Rename the formatInfoMap map accordingly.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/v4l2_subdevice.cpp | 22 +++++++++++-----------\n>  1 file changed, 11 insertions(+), 11 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 9b118063e696..b6a25e25230b 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>         unsigned int bitsPerPixel;\n>         const char *name;\n>         PixelFormatInfo::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>         /* This table is sorted to match the order in linux/media-bus-format.h */\n>         { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, \"RGB444_2X8_PADHI_BE\", PixelFormatInfo::ColourEncodingRGB } },\n>         { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, \"RGB444_2X8_PADHI_LE\", PixelFormatInfo::ColourEncodingRGB } },\n> @@ -241,8 +241,8 @@ const std::string V4L2SubdeviceFormat::toString() const\n>   */\n>  uint8_t V4L2SubdeviceFormat::bitsPerPixel() const\n>  {\n> -       const auto it = formatInfoMap.find(mbus_code);\n> -       if (it == formatInfoMap.end()) {\n> +       const auto it = mediaBusFormatInfo.find(mbus_code);\n> +       if (it == mediaBusFormatInfo.end()) {\n>                 LOG(V4L2, Error) << \"No information available for format '\"\n>                                  << *this << \"'\";\n>                 return 0;\n> @@ -262,9 +262,9 @@ std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f)\n>  {\n>         out << f.size << \"-\";\n>  \n> -       const auto it = formatInfoMap.find(f.mbus_code);\n> +       const auto it = mediaBusFormatInfo.find(f.mbus_code);\n>  \n> -       if (it == formatInfoMap.end())\n> +       if (it == mediaBusFormatInfo.end())\n>                 out << utils::hex(f.mbus_code, 4);\n>         else\n>                 out << it->second.name;\n> @@ -515,8 +515,8 @@ std::optional<ColorSpace> V4L2Subdevice::toColorSpace(const v4l2_mbus_framefmt &\n>                 return std::nullopt;\n>  \n>         PixelFormatInfo::ColourEncoding colourEncoding;\n> -       auto iter = formatInfoMap.find(format.code);\n> -       if (iter != formatInfoMap.end()) {\n> +       auto iter = mediaBusFormatInfo.find(format.code);\n> +       if (iter != mediaBusFormatInfo.end()) {\n>                 colourEncoding = iter->second.colourEncoding;\n>         } else {\n>                 LOG(V4L2, Warning)\n> -- \n> Regards,\n> \n> Laurent Pinchart\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 91050BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Mar 2024 00:23:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A4DA362C93;\n\tFri, 15 Mar 2024 01:23:19 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 37B2962973\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Mar 2024 01:23:18 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 70CD0667;\n\tFri, 15 Mar 2024 01:22:54 +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=\"XfddTjRC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710462174;\n\tbh=sXsMT6Kw7uwRMIRfFV7Xgd6+u/MKlx2YyLxd9V485Gc=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=XfddTjRCBLtcP2ravcz1p/dRLcF+np2BlR63x4jm2AuDJHowHIRWOLmlmkDCzYQwV\n\tHTeF/oboBgC7dAZbrNzPubXg1BERYmSxD1ujEG40r2Qsr6r1r38X2fqHTPYcbGFkEd\n\tZxlEH2aWVVRLDDoUu9FSxWg//S7mG/mbNSerxGzA=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240315001613.2033-2-laurent.pinchart@ideasonboard.com>","References":"<20240315001613.2033-1-laurent.pinchart@ideasonboard.com>\n\t<20240315001613.2033-2-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v2 01/14] libcamera: v4l2_subdevice: Rename\n\tV4L2SubdeviceFormatInfo","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 15 Mar 2024 00:23:15 +0000","Message-ID":"<171046219506.1913896.9951336341136877990@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]