[{"id":15332,"web_url":"https://patchwork.libcamera.org/comment/15332/","msgid":"<YDvfPZ4JZoRk6wyd@pendragon.ideasonboard.com>","date":"2021-02-28T18:21:49","subject":"Re: [libcamera-devel] [PATCH 04/12] android: camera_buffer: Drop\n\t'const' from buffer_handle_t","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 26, 2021 at 02:29:24PM +0100, Jacopo Mondi wrote:\n> The buffer_handle_t type is defined as 'const native_handle_t*'.\n> Drop the 'const' specifier from the parameter of the CameraBuffer\n> class constructor and in the Android generic memory backend.\n> \n> Also rename 'camera3buffer' in 'camera3Buffer' to comply with the\n> coding style guidelines.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/android/camera_buffer.h               |  2 +-\n>  src/android/mm/android_generic_buffer.cpp | 12 ++++++------\n>  2 files changed, 7 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h\n> index 00b061502d6e..0590cd84652b 100644\n> --- a/src/android/camera_buffer.h\n> +++ b/src/android/camera_buffer.h\n> @@ -14,7 +14,7 @@\n>  class CameraBuffer : public libcamera::MappedBuffer\n>  {\n>  public:\n> -\tCameraBuffer(const buffer_handle_t camera3buffer, int flags);\n> +\tCameraBuffer(buffer_handle_t camera3Buffer, int flags);\n>  \t~CameraBuffer();\n>  };\n>  \n> diff --git a/src/android/mm/android_generic_buffer.cpp b/src/android/mm/android_generic_buffer.cpp\n> index 6f41215bb0f9..807304a9e42d 100644\n> --- a/src/android/mm/android_generic_buffer.cpp\n> +++ b/src/android/mm/android_generic_buffer.cpp\n> @@ -13,16 +13,16 @@ using namespace libcamera;\n>  \n>  LOG_DECLARE_CATEGORY(HAL)\n>  \n> -CameraBuffer::CameraBuffer(const buffer_handle_t camera3buffer, int flags)\n> +CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)\n>  {\n> -\tmaps_.reserve(camera3buffer->numFds);\n> +\tmaps_.reserve(camera3Buffer->numFds);\n>  \terror_ = 0;\n>  \n> -\tfor (int i = 0; i < camera3buffer->numFds; i++) {\n> -\t\tif (camera3buffer->data[i] == -1)\n> +\tfor (int i = 0; i < camera3Buffer->numFds; i++) {\n> +\t\tif (camera3Buffer->data[i] == -1)\n>  \t\t\tcontinue;\n>  \n> -\t\toff_t length = lseek(camera3buffer->data[i], 0, SEEK_END);\n> +\t\toff_t length = lseek(camera3Buffer->data[i], 0, SEEK_END);\n>  \t\tif (length < 0) {\n>  \t\t\terror_ = -errno;\n>  \t\t\tLOG(HAL, Error) << \"Failed to query plane length\";\n> @@ -30,7 +30,7 @@ CameraBuffer::CameraBuffer(const buffer_handle_t camera3buffer, int flags)\n>  \t\t}\n>  \n>  \t\tvoid *address = mmap(nullptr, length, flags, MAP_SHARED,\n> -\t\t\t\t     camera3buffer->data[i], 0);\n> +\t\t\t\t     camera3Buffer->data[i], 0);\n>  \t\tif (address == MAP_FAILED) {\n>  \t\t\terror_ = -errno;\n>  \t\t\tLOG(HAL, Error) << \"Failed to mmap plane\";","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 9180BBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Feb 2021 18:22:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 600C268A72;\n\tSun, 28 Feb 2021 19:22:19 +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 3355C68A45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Feb 2021 19:22:18 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BC17F80F;\n\tSun, 28 Feb 2021 19:22:17 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QGGJ99K6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614536537;\n\tbh=76LaAHkTlJ1pVd9CSJvyoWAUly1uw5iGIvZdb4qaDtY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QGGJ99K6NFge22ybXx+gSSzT9xuQJhQh/fWMJBGOooc/Y9MmYqj/gzDiLfGfwHedb\n\tQCuODju2QdoSmQ+wdmbkA/eZZBGbbQMxJm+TB6njrQc84DaiiVIRO7h/1Vo6V2bx/o\n\tL6kEJJhQjdxLODSMqb3ZTKTibjqVAozUbXZQ2XQk=","Date":"Sun, 28 Feb 2021 20:21:49 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YDvfPZ4JZoRk6wyd@pendragon.ideasonboard.com>","References":"<20210226132932.165484-1-jacopo@jmondi.org>\n\t<20210226132932.165484-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210226132932.165484-5-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 04/12] android: camera_buffer: Drop\n\t'const' from buffer_handle_t","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","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]