[{"id":23163,"web_url":"https://patchwork.libcamera.org/comment/23163/","msgid":"<Yo+dYr/lj25Rvc41@pendragon.ideasonboard.com>","date":"2022-05-26T15:31:46","subject":"Re: [libcamera-devel] [PATCH v2 08/19] py: MappedFrameBuffer: Add\n\ttype hints & docs","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Tue, May 24, 2022 at 02:45:59PM +0300, Tomi Valkeinen wrote:\n> Add a few type hints and (minimal) docs to MappedFrameBuffer.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/py/libcamera/utils/MappedFrameBuffer.py | 11 +++++++++--\n>  1 file changed, 9 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/py/libcamera/utils/MappedFrameBuffer.py b/src/py/libcamera/utils/MappedFrameBuffer.py\n> index e7dd16ec..fc2726b6 100644\n> --- a/src/py/libcamera/utils/MappedFrameBuffer.py\n> +++ b/src/py/libcamera/utils/MappedFrameBuffer.py\n> @@ -1,8 +1,14 @@\n>  # SPDX-License-Identifier: LGPL-2.1-or-later\n>  # Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n>  \n> +import libcamera\n> +from typing import Tuple\n> +\n>  class MappedFrameBuffer:\n> -    def __init__(self, fb):\n> +    \"\"\"\n> +    Provides memoryviews for the FrameBuffer's planes\n> +    \"\"\"\n> +    def __init__(self, fb: libcamera.FrameBuffer):\n>          self.__fb = fb\n>  \n>      def __enter__(self):\n> @@ -70,5 +76,6 @@ class MappedFrameBuffer:\n>              mm.close()\n>  \n>      @property\n> -    def planes(self):\n> +    def planes(self) -> Tuple[memoryview, ...]:\n> +        \"\"\"memoryviews for the planes\"\"\"\n>          return self.__planes","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 79217BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 May 2022 15:31:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EFB6611BF;\n\tThu, 26 May 2022 17:31:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D79E60DB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 May 2022 17:31:53 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [37.120.212.14])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D53D332A;\n\tThu, 26 May 2022 17:31:52 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653579115;\n\tbh=bJ8STjrg7MYI/PocxY2u0tD8tLqFQu93OIMaBvNYUeM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=VSYAazekEHD0mPHPXobPKN88WSLmoWkbUFT+adbYkFrUMHZsiLHbxXOGxmUC5pi6d\n\tWzr1gAwHZRxywqvgC9G1uEn2yZatuYHywl2l+yNXCTr2E/bGYR0QZEH0spvlNM8wYn\n\tbqlCUseUAMK/3BNNsFZcDoJFNqfhPlXWrmJ1LUIEORm4c+nGW8xFrY59GdRDLF/54U\n\tWMiLRjuxuoxDePBAzymdom4/26ifxb2MQKL9ROklsneOpRZ7kzL6AyXmKWGkUhonbx\n\tExLUvkySIB7ZZIrAp6o7/IlcHokVdceNcGkJAv0nHGfNHmZU3JQi6h0KmyDROF4Kuy\n\tiQkzBKfsaeamg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1653579113;\n\tbh=bJ8STjrg7MYI/PocxY2u0tD8tLqFQu93OIMaBvNYUeM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LrU2CBxeZrUQilnGQUxfWwGm4hMgAV2pbbq9qPeJLt+j0CdndS53SamllJjpIFnAx\n\tKlL14+PNyWg2LIbAqu7EmxhxEs4GIGeBSv3GT7XRFRAbMmf4YhAP+DCgJVTIHkn7OK\n\tc+32F12kYL05NM1MZtu9gL3XUQG+sIq7PMsFiIy0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LrU2CBxe\"; dkim-atps=neutral","Date":"Thu, 26 May 2022 18:31:46 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<Yo+dYr/lj25Rvc41@pendragon.ideasonboard.com>","References":"<20220524114610.41848-1-tomi.valkeinen@ideasonboard.com>\n\t<20220524114610.41848-9-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220524114610.41848-9-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 08/19] py: MappedFrameBuffer: Add\n\ttype hints & docs","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]