{"id":13308,"url":"https://patchwork.libcamera.org/api/1.1/covers/13308/?format=json","web_url":"https://patchwork.libcamera.org/cover/13308/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210811232625.17280-1-laurent.pinchart@ideasonboard.com>","date":"2021-08-11T23:26:11","name":"[libcamera-devel,v3,00/14] libcamera: Replace CameraData with Camera::Private","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/13308/mbox/","series":[{"id":2341,"url":"https://patchwork.libcamera.org/api/1.1/series/2341/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2341","date":"2021-08-11T23:26:11","name":"libcamera: Replace CameraData with Camera::Private","version":3,"mbox":"https://patchwork.libcamera.org/series/2341/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/13308/comments/","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 10224BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Aug 2021 23:26:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DD0196888C;\n\tThu, 12 Aug 2021 01:26: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 E0290687F0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Aug 2021 01:26:32 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 769E1EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Aug 2021 01:26:32 +0200 (CEST)"],"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=\"JieNgZrz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628724392;\n\tbh=sEzhxEyUvIc6Yb9qsOUGWrTf5z0SU39znpgWKTMZCBM=;\n\th=From:To:Subject:Date:From;\n\tb=JieNgZrzXvVBlz6/pebeldxogM3EcK9Qkw+OtuxjC9q10jRYPVgf7ilG9tbvT5+UC\n\tx1Kuq4T6f+TLCewO6qVW7DVyCwEPagptWR/VP51e7gQpp6SkM55ricT6PQjFso2zNx\n\tot/dk5UMvYjJlppbiQ4cmUo7DfJospdMdZBRYor0=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 12 Aug 2021 02:26:11 +0300","Message-Id":"<20210811232625.17280-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 00/14] libcamera: Replace CameraData\n\twith Camera::Private","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>"},"content":"Hello,\n\nThis patch series reworks the libcamera core and pipeline handlers to\ndrop the CameraData class, replacing it with Camera::Private.\n\nThe Camera::Private class implements the d-pointer design pattern for\nthe Camera class, and stores internal camera data that shouldn't be\nvisible through the public API. The CameraData class is a container used\nby pipeline handlers to store per-camera private data. The two classes\nthus overlap in their purpose.\n\nThis series cleans up this situation by merging CameraData into\nCamera::Private. Pipeline handlers then subclass Camera::Private instead\nof CameraData, and pass the private data directly to the Camera\nconstructor.\n\nThe first 7 patches from the first RFC version, preparing for this\nchange, have been merged. Compared to v2, this version starts in 01/14\nwith a new patch that replaces with the Extensible::Private pointer\npassed to the Extensible constructor with a std::unique_ptr<>, better\nreflecting the lifetime management of the private data. Patch 04/14 is\nalso new and addresses minor documentation issues.\n\nIn 02/14, the pointer to the private data is now passed explicitly to\nthe Camera constructor, to allow subclassing Camera::Private in pipeline\nhandlers. After that, changes are fairly straightforward. Patch 03/14\nmoves the members of the existing CameraData class to Camera::Private.\nPatches 05/14 to 10/14 update pipeline handlers individually to migrate\nto Camera::Private. Patch 11/14 then cleans up by dropping the\nCameraData class, and patch 12/14 updates the pipeline handler guide\naccordingly.\n\nFinally, patches 13/14 and 14/14 are follow-up improvements, both\nsuggested by Jacopo. 13/14 drops the indirection in the implementation\nof Camera::controls() and Camera::properties(). It looks quite neat in\nmy opinion, and worth the effort. 14/14 introduces helper functions in\ntwo pipeline handlers that need cast the PipelineHandler base class to\nthe derived class. It seems to bring a slight simplification, but I\ndon't have a strong preference there.\n\nI've tested the ipu3, raspberrypi, simple, uvcvideo and vimc pipeline\nhandlers. If someone could test rkisp1, that would be appreciated.\n\nLaurent Pinchart (14):\n  libcamera: base: extensible: Pass private pointer as unique_ptr<>\n  libcamera: camera: Pass Private pointer to Camera constructor\n  libcamera: pipeline_handler: Move CameraData members to\n    Camera::Private\n  libcamera: camera: Fix minor issues in Camera::Private documentation\n  libcamera: pipeline: simple: Migrate to Camera::Private\n  libcamera: pipeline: uvcvideo: Migrate to Camera::Private\n  libcamera: pipeline: vimc: Migrate to Camera::Private\n  libcamera: pipeline: rkisp1: Migrate to Camera::Private\n  libcamera: pipeline: raspberrypi: Migrate to Camera::Private\n  libcamera: pipeline: ipu3: Migrate to Camera::Private\n  libcamera: pipeline_handler: Drop CameraData class\n  Documentation: guides: pipeline-handler: Migrate to Camera::Private\n  libcamera: pipeline_handler: Drop controls() and properties()\n    functions\n  libcamera: pipeline: Cast to derived pipeline handler with helpers\n\n Documentation/Doxyfile.in                     |   1 -\n Documentation/guides/pipeline-handler.rst     |  67 ++++-----\n include/libcamera/base/class.h                |   2 +-\n include/libcamera/camera.h                    |   4 +-\n include/libcamera/internal/camera.h           |  12 +-\n include/libcamera/internal/pipeline_handler.h |  33 +----\n src/android/camera_buffer.h                   |   2 +-\n src/android/camera_hal_config.cpp             |   2 +-\n src/libcamera/base/class.cpp                  |  11 +-\n src/libcamera/camera.cpp                      |  89 +++++++++--\n src/libcamera/camera_manager.cpp              |   2 +-\n src/libcamera/framebuffer.cpp                 |   3 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp          |  38 ++---\n .../pipeline/raspberrypi/raspberrypi.cpp      |  24 +--\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  34 +++--\n src/libcamera/pipeline/simple/simple.cpp      |  31 ++--\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  19 +--\n src/libcamera/pipeline/vimc/vimc.cpp          |  19 +--\n src/libcamera/pipeline_handler.cpp            | 138 +-----------------\n 19 files changed, 235 insertions(+), 296 deletions(-)"}