[{"id":28829,"web_url":"https://patchwork.libcamera.org/comment/28829/","msgid":"<52gfqvpwui76kfkfhd5k6y5voobwwxaplfxkryf7jagikkcvkb@bsm2kth4k4yb>","date":"2024-03-04T17:28:31","subject":"Re: [PATCH/RFC 12/32] libcamera: v4l2_subdevice: Add new metadata\n\tformats","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi laurent\n\nOn Fri, Mar 01, 2024 at 11:21:01PM +0200, Laurent Pinchart wrote:\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> ---\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 d5d400cdfd58..c2c9577cba9c 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -645,6 +645,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\nAre these 0s safe ?\n\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> +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> +\t} },\n>  };\n>\n>  } /* namespace */\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 4AD0DC326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 17:28:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A7BC6286C;\n\tMon,  4 Mar 2024 18:28:36 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F1634627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 18:28:34 +0100 (CET)","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 80E22BD1;\n\tMon,  4 Mar 2024 18:28:18 +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=\"uI9askpj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709573298;\n\tbh=VNRL1Me9gnXWJgRa2ktIgTOdAWn8mBYOb3h7LIewWHE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uI9askpj4ffD7O8sTOl0JTz4pkDYjmHxZe3UMbUSUDHyGlRuiUJuT/KS0PRHqYTkv\n\tVfnv99nXBwvazBD19E/1tVOO1JirNjSnkFAy4Y76VDEmhfK6Lnj+/nbuhu622OODmQ\n\tIK2FXr50GyZ3qBm3pwwlOL1P09Jmhcux1GFfq5Cs=","Date":"Mon, 4 Mar 2024 18:28:31 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH/RFC 12/32] libcamera: v4l2_subdevice: Add new metadata\n\tformats","Message-ID":"<52gfqvpwui76kfkfhd5k6y5voobwwxaplfxkryf7jagikkcvkb@bsm2kth4k4yb>","References":"<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>\n\t<20240301212121.9072-13-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240301212121.9072-13-laurent.pinchart@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>","Cc":"libcamera-devel@lists.libcamera.org, Sakari Ailus <sakari.ailus@iki.fi>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28839,"web_url":"https://patchwork.libcamera.org/comment/28839/","msgid":"<20240304224715.GE9233@pendragon.ideasonboard.com>","date":"2024-03-04T22:47:15","subject":"Re: [PATCH/RFC 12/32] libcamera: v4l2_subdevice: Add new metadata\n\tformats","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Mar 04, 2024 at 06:28:31PM +0100, Jacopo Mondi wrote:\n> On Fri, Mar 01, 2024 at 11:21:01PM +0200, Laurent Pinchart wrote:\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> > ---\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 d5d400cdfd58..c2c9577cba9c 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -645,6 +645,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> \n> Are these 0s safe ?\n\nAs safe as it gets :-) The value is unused for now, the CameraSensorRaw\nclass doesn't need to know the bpp for the media bus format on the\ninternal embedded data pad. I don't see what it would be useful for, but\nif that were to change in the future, we'll figure something out.\n\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> > +\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRAW,\n> > +\t} },\n> >  };\n> >\n> >  } /* namespace */","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 DFE2DC326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 22:47:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C35106286F;\n\tMon,  4 Mar 2024 23:47:15 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1DBCB627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 23:47:14 +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 3531E22E8;\n\tMon,  4 Mar 2024 23:46:57 +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=\"pvJ9U5DL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709592417;\n\tbh=CmPvjC+yMKZDhqDYWsMLc85E38NhwaFD8Z6JGikUVBY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pvJ9U5DLTQzT2VxGlzKNiVFDvD/0UJ3QpOEucUI/1+/saE7cJp9CCD7xqg1dLCTzf\n\tmI1bGMwFvuk+FFogjEtkPe/q+z/BLqsfLgRxpERRRPqjnQGxfoHOd2JM1VmqFqPWce\n\tBBxReeZHybu0iggTJjHvdjKvPoNwvoeJap9kVbfo=","Date":"Tue, 5 Mar 2024 00:47:15 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH/RFC 12/32] libcamera: v4l2_subdevice: Add new metadata\n\tformats","Message-ID":"<20240304224715.GE9233@pendragon.ideasonboard.com>","References":"<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>\n\t<20240301212121.9072-13-laurent.pinchart@ideasonboard.com>\n\t<52gfqvpwui76kfkfhd5k6y5voobwwxaplfxkryf7jagikkcvkb@bsm2kth4k4yb>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<52gfqvpwui76kfkfhd5k6y5voobwwxaplfxkryf7jagikkcvkb@bsm2kth4k4yb>","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>","Cc":"libcamera-devel@lists.libcamera.org, Sakari Ailus <sakari.ailus@iki.fi>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]