[{"id":31890,"web_url":"https://patchwork.libcamera.org/comment/31890/","msgid":"<tm5jp3snwrtillm5akiltdfdeboylklngxudd3wwvtpxr4itfp@blxhdfpycng4>","date":"2024-10-23T11:14:29","subject":"Re: [PATCH 3/4] libcamera: v4l2_subdevice: Add new metadata formats","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Laurent\n\nOn Wed, Oct 23, 2024 at 01:11:22PM +0200, Jacopo Mondi wrote:\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> Support the newly introduced V4L2 media bus formats for metadata. This\n> includes generic metadata formats, and two sensor-specific embedded data\n> formats.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/libcamera/v4l2_subdevice.cpp | 63 ++++++++++++++++++++++++++++++++\n>  1 file changed, 63 insertions(+)\n>\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 9f2ec4798407..f65dd6593c99 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -700,6 +700,69 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{\n>  \t\t.bitsPerPixel = 0,\n>  \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n>  \t} },\n> +\t{ MEDIA_BUS_FMT_META_8, {\n> +\t\t.name = \"META_8\",\n> +\t\t.code = MEDIA_BUS_FMT_META_8,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 8,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_META_10, {\n> +\t\t.name = \"META_10\",\n> +\t\t.code = MEDIA_BUS_FMT_META_10,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 10,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_META_12, {\n> +\t\t.name = \"META_12\",\n> +\t\t.code = MEDIA_BUS_FMT_META_12,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 12,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_META_14, {\n> +\t\t.name = \"META_14\",\n> +\t\t.code = MEDIA_BUS_FMT_META_14,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 14,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_META_16, {\n> +\t\t.name = \"META_16\",\n> +\t\t.code = MEDIA_BUS_FMT_META_16,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 16,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_META_20, {\n> +\t\t.name = \"META_20\",\n> +\t\t.code = MEDIA_BUS_FMT_META_20,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 20,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_META_24, {\n> +\t\t.name = \"META_24\",\n> +\t\t.code = MEDIA_BUS_FMT_META_24,\n> +\t\t.type = MediaBusFormatInfo::Type::Metadata,\n> +\t\t.bitsPerPixel = 24,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_CCS_EMBEDDED, {\n> +\t\t.name = \"CCS_EMBEDDED\",\n> +\t\t.code = MEDIA_BUS_FMT_CCS_EMBEDDED,\n> +\t\t.type = MediaBusFormatInfo::Type::EmbeddedData,\n> +\t\t.bitsPerPixel = 0,\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n> +\t{ MEDIA_BUS_FMT_OV2740_EMBEDDED, {\n> +\t\t.name = \"OV2740_EMBEDDED\",\n> +\t\t.code = MEDIA_BUS_FMT_CCS_EMBEDDED,\n> +\t\t.type = MediaBusFormatInfo::Type::EmbeddedData,\n> +\t\t.bitsPerPixel = 0,\n\nI understand for these formats the actual bitdepth depends on the\nformat configured on the sensor. But isn't bitsPerPixel=0 potentially\ndangerous ?\n\n> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n>  };\n>\n>  } /* namespace */\n> --\n> 2.47.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 48299C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Oct 2024 11:14:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6EB0765393;\n\tWed, 23 Oct 2024 13:14:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 717686537E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Oct 2024 13:14:33 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0CE3F82A;\n\tWed, 23 Oct 2024 13:12:46 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"hdyhfP4l\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1729681966;\n\tbh=nV7Esve3vP2uXxuGx03RlhbwQsPVOoanQ7LME0lEcmo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hdyhfP4lsDMfoV4h3jjrtTF6+AsgOt30xKd/5anX8EziknnWkRsajqq21fT7Paizq\n\tKhCSlSyE0HEjOpELXJdM1HmWs62DrlwkP23LHrFawDkC8Fg4B5Y+eobNeBAeC+cuA/\n\tsB1HvNPpi0YruJcHv3i8wEDYdcWr0CXZCxCUgufE=","Date":"Wed, 23 Oct 2024 13:14:29 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 3/4] libcamera: v4l2_subdevice: Add new metadata formats","Message-ID":"<tm5jp3snwrtillm5akiltdfdeboylklngxudd3wwvtpxr4itfp@blxhdfpycng4>","References":"<20241023111124.124090-1-jacopo.mondi@ideasonboard.com>\n\t<20241023111124.124090-4-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241023111124.124090-4-jacopo.mondi@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>"}}]