[{"id":746,"web_url":"https://patchwork.libcamera.org/comment/746/","msgid":"<20190201223431.GF4359@pendragon.ideasonboard.com>","date":"2019-02-01T22:34:31","subject":"Re: [libcamera-devel] [PATCH 4/7] libcamera: v4l2_device: Rename\n\tplane format fields","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, Feb 01, 2019 at 04:42:45PM +0100, Jacopo Mondi wrote:\n> Rename the number of valid plane formats to 'planesCount' and the actual\n> per-plane size information array to 'planes'.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nAcked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/include/v4l2_device.h |  4 ++--\n>  src/libcamera/v4l2_device.cpp       | 29 ++++++++++++++---------------\n>  2 files changed, 16 insertions(+), 17 deletions(-)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index e65a540..4ff48fb 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -63,8 +63,8 @@ public:\n>  \tstruct {\n>  \t\tuint32_t size;\n>  \t\tuint32_t bpl;\n> -\t} planesFmt[3];\n> -\tunsigned int planes;\n> +\t} planes[3];\n> +\tunsigned int planesCount;\n>  };\n>  \n>  class MediaEntity;\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 8cf566c..0d4d60f 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -92,7 +92,7 @@ LOG_DEFINE_CATEGORY(V4L2)\n>   *\n>   * Formats defined as 'single planar' by the V4L2 APIs are represented with\n>   * V4L2DeviceFormat instances with a single plane\n> - * (V4L2DeviceFormat::planes = 1). Semi-planar and multiplanar formats use\n> + * (V4L2DeviceFormat::planesCount = 1). Semi-planar and multiplanar formats use\n>   * 2 and 3 planes respectively.\n>   *\n>   * V4L2DeviceFormat defines the exchange format between components that\n> @@ -120,19 +120,18 @@ LOG_DEFINE_CATEGORY(V4L2)\n>   */\n>  \n>  /**\n> - * \\var V4L2DeviceFormat::planesFmt\n> + * \\var V4L2DeviceFormat::planes\n>   * \\brief The per-plane size information\n>   *\n>   * Images are stored in memory in one or more data planes. Each data plane\n>   * has a specific size and line length, which could differ from the image\n>   * visible sizes to accommodate line or plane padding data.\n>   *\n> - * Only the first V4L2DeviceFormat::planes entries are considered valid.\n> - *\n> + * Only the first \\ref planesCount entries are considered valid.\n>   */\n>  \n>  /**\n> - * \\var V4L2DeviceFormat::planes\n> + * \\var V4L2DeviceFormat::planesCount\n>   * \\brief The number of valid data planes\n>   */\n>  \n> @@ -315,9 +314,9 @@ int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format)\n>  \tformat->width = pix->width;\n>  \tformat->height = pix->height;\n>  \tformat->fourcc = pix->pixelformat;\n> -\tformat->planes = 1;\n> -\tformat->planesFmt[0].bpl = pix->bytesperline;\n> -\tformat->planesFmt[0].size = pix->sizeimage;\n> +\tformat->planesCount = 1;\n> +\tformat->planes[0].bpl = pix->bytesperline;\n> +\tformat->planes[0].size = pix->sizeimage;\n>  \n>  \treturn 0;\n>  }\n> @@ -360,11 +359,11 @@ int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format)\n>  \tformat->width = pix->width;\n>  \tformat->height = pix->height;\n>  \tformat->fourcc = pix->pixelformat;\n> -\tformat->planes = pix->num_planes;\n> +\tformat->planesCount = pix->num_planes;\n>  \n> -\tfor (unsigned int i = 0; i < format->planes; ++i) {\n> -\t\tformat->planesFmt[i].bpl = pix->plane_fmt[i].bytesperline;\n> -\t\tformat->planesFmt[i].size = pix->plane_fmt[i].sizeimage;\n> +\tfor (unsigned int i = 0; i < format->planesCount; ++i) {\n> +\t\tformat->planes[i].bpl = pix->plane_fmt[i].bytesperline;\n> +\t\tformat->planes[i].size = pix->plane_fmt[i].sizeimage;\n>  \t}\n>  \n>  \treturn 0;\n> @@ -380,11 +379,11 @@ int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format)\n>  \tpix->width = format->width;\n>  \tpix->height = format->height;\n>  \tpix->pixelformat = format->fourcc;\n> -\tpix->num_planes = format->planes;\n> +\tpix->num_planes = format->planesCount;\n>  \n>  \tfor (unsigned int i = 0; i < pix->num_planes; ++i) {\n> -\t\tpix->plane_fmt[i].bytesperline = format->planesFmt[i].bpl;\n> -\t\tpix->plane_fmt[i].sizeimage = format->planesFmt[i].size;\n> +\t\tpix->plane_fmt[i].bytesperline = format->planes[i].bpl;\n> +\t\tpix->plane_fmt[i].sizeimage = format->planes[i].size;\n>  \t}\n>  \n>  \tret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Format);","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE65760B10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Feb 2019 23:34:37 +0100 (CET)","from pendragon.ideasonboard.com (85-76-65-45-nat.elisa-mobile.fi\n\t[85.76.65.45])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1A9774F7;\n\tFri,  1 Feb 2019 23:34:35 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1549060477;\n\tbh=7lWDB7K5593snpxp7qC2JCHIzSpgVAJspvYHkT7ZBC8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BHExZ3l1hWM30g4dMNGimXCNED2pU/CVzy2hBXm43q1ZgQaNgH6CqGLTbI8XW5X8t\n\tQNEq5XRlt8GJMdgoQWCCfQYzpyVa9fwENsjZJmHQSguOwGzmpx7wo40tRBb5RAQyI3\n\tftlvgnR82zZfHNszIdmXK3Ow7Vn+Ftkj5i8U59J8=","Date":"Sat, 2 Feb 2019 00:34:31 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190201223431.GF4359@pendragon.ideasonboard.com>","References":"<20190201154248.15006-1-jacopo@jmondi.org>\n\t<20190201154248.15006-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190201154248.15006-5-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 4/7] libcamera: v4l2_device: Rename\n\tplane format fields","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Fri, 01 Feb 2019 22:34:37 -0000"}}]