Patch Detail
Show a patch.
GET /api/patches/13319/?format=api
{ "id": 13319, "url": "https://patchwork.libcamera.org/api/patches/13319/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13319/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "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-12-laurent.pinchart@ideasonboard.com>", "date": "2021-08-11T23:26:22", "name": "[libcamera-devel,v3,11/14] libcamera: pipeline_handler: Drop CameraData class", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "65c2bad0f3d1d1210f2a77ee0b21639d9dd3c0c4", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/13319/mbox/", "series": [ { "id": 2341, "url": "https://patchwork.libcamera.org/api/series/2341/?format=api", "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/patches/13319/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13319/checks/", "tags": {}, "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 C350AC3241\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Aug 2021 23:26:45 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 746FF688CA;\n\tThu, 12 Aug 2021 01:26:45 +0200 (CEST)", "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 9163C68893\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Aug 2021 01:26:36 +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 3AD28EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Aug 2021 01:26:36 +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=\"n4UfiY8z\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628724396;\n\tbh=Uyq9uvRvom7KApb33lNcLqjofStEveAZppiatBVwlGk=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=n4UfiY8zgvirXYfup2WOGXq8sYtZbnrW6UlucYNpxciAg/xe9ZYkI0/VKO4yaJEts\n\ttL84y0aHc0r2Rktp4rJxgg3jWi8MFytGoWd748Whmfy5OB8JYZZ1pXGv7idnL4SDQB\n\t1Fs0lXbZfVrTSmEut8lEuRoyQfKGfWPIUFdiIWck=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 12 Aug 2021 02:26:22 +0300", "Message-Id": "<20210811232625.17280-12-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20210811232625.17280-1-laurent.pinchart@ideasonboard.com>", "References": "<20210811232625.17280-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 11/14] libcamera: pipeline_handler:\n\tDrop CameraData class", "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": "The CameraData class isn't used anymore. Drop it.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/internal/pipeline_handler.h | 26 +----\n src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +-\n .../pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +-\n src/libcamera/pipeline/simple/simple.cpp | 2 +-\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +-\n src/libcamera/pipeline/vimc/vimc.cpp | 2 +-\n src/libcamera/pipeline_handler.cpp | 94 +------------------\n 8 files changed, 9 insertions(+), 123 deletions(-)", "diff": "diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex 24b0c5ca081c..1e48f7076d18 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -7,14 +7,12 @@\n #ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n \n-#include <map>\n #include <memory>\n #include <set>\n #include <string>\n #include <sys/types.h>\n #include <vector>\n \n-#include <libcamera/base/class.h>\n #include <libcamera/base/object.h>\n \n #include <libcamera/controls.h>\n@@ -34,23 +32,6 @@ class MediaDevice;\n class PipelineHandler;\n class Request;\n \n-class CameraData\n-{\n-public:\n-\texplicit CameraData(PipelineHandler *pipe)\n-\t\t: pipe_(pipe)\n-\t{\n-\t}\n-\tvirtual ~CameraData() = default;\n-\n-\tPipelineHandler *pipe_;\n-\tControlInfoMap controlInfo_;\n-\tControlList properties_;\n-\n-private:\n-\tLIBCAMERA_DISABLE_COPY(CameraData)\n-};\n-\n class PipelineHandler : public std::enable_shared_from_this<PipelineHandler>,\n \t\t\tpublic Object\n {\n@@ -87,15 +68,11 @@ public:\n \tconst char *name() const { return name_; }\n \n protected:\n-\tvoid registerCamera(std::shared_ptr<Camera> camera,\n-\t\t\t std::unique_ptr<CameraData> data);\n+\tvoid registerCamera(std::shared_ptr<Camera> camera);\n \tvoid hotplugMediaDevice(MediaDevice *media);\n \n \tvirtual int queueRequestDevice(Camera *camera, Request *request) = 0;\n \n-\tCameraData *cameraData(const Camera *camera);\n-\tconst CameraData *cameraData(const Camera *camera) const;\n-\n \tCameraManager *manager_;\n \n private:\n@@ -104,7 +81,6 @@ private:\n \n \tstd::vector<std::shared_ptr<MediaDevice>> mediaDevices_;\n \tstd::vector<std::weak_ptr<Camera>> cameras_;\n-\tstd::map<const Camera *, std::unique_ptr<CameraData>> cameraData_;\n \n \tconst char *name_;\n \ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 4d07592e0c7e..cd790f5fb234 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -1201,7 +1201,7 @@ int PipelineHandlerIPU3::registerCameras()\n \t\tstd::shared_ptr<Camera> camera =\n \t\t\tCamera::create(std::move(data), cameraId, streams);\n \n-\t\tregisterCamera(std::move(camera), nullptr);\n+\t\tregisterCamera(std::move(camera));\n \n \t\tLOG(IPU3, Info)\n \t\t\t<< \"Registered Camera[\" << numCameras << \"] \\\"\"\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex b615e4fa12c2..b2674ac02109 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1108,7 +1108,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \tconst std::string &id = data->sensor_->id();\n \tstd::shared_ptr<Camera> camera =\n \t\tCamera::create(std::move(data), id, streams);\n-\tregisterCamera(std::move(camera), nullptr);\n+\tregisterCamera(std::move(camera));\n \n \treturn true;\n }\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex bcaec77eca26..3c37a8ccad8f 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -973,7 +973,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \tconst std::string &id = data->sensor_->id();\n \tstd::shared_ptr<Camera> camera =\n \t\tCamera::create(std::move(data), id, streams);\n-\tregisterCamera(std::move(camera), nullptr);\n+\tregisterCamera(std::move(camera));\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 947f3f1f8bd6..ef7687eaf502 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -1050,7 +1050,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \t\tconst std::string &id = data->sensor_->id();\n \t\tstd::shared_ptr<Camera> camera =\n \t\t\tCamera::create(std::move(data), id, streams);\n-\t\tregisterCamera(std::move(camera), nullptr);\n+\t\tregisterCamera(std::move(camera));\n \t\tregistered = true;\n \t}\n \ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 5ee2357d262a..eee06b6e753f 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -472,7 +472,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n \tstd::set<Stream *> streams{ &data->stream_ };\n \tstd::shared_ptr<Camera> camera =\n \t\tCamera::create(std::move(data), id, streams);\n-\tregisterCamera(std::move(camera), nullptr);\n+\tregisterCamera(std::move(camera));\n \n \t/* Enable hot-unplug notifications. */\n \thotplugMediaDevice(media);\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 0ce467e8e520..37e34d2e1962 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -440,7 +440,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \tconst std::string &id = data->sensor_->id();\n \tstd::shared_ptr<Camera> camera =\n \t\tCamera::create(std::move(data), id, streams);\n-\tregisterCamera(std::move(camera), nullptr);\n+\tregisterCamera(std::move(camera));\n \n \treturn true;\n }\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 0e571d8981df..62d29cbeff02 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -39,55 +39,6 @@ namespace libcamera {\n \n LOG_DEFINE_CATEGORY(Pipeline)\n \n-/**\n- * \\class CameraData\n- * \\brief Base class for platform-specific data associated with a camera\n- *\n- * The CameraData base abstract class represents platform specific-data\n- * a pipeline handler might want to associate with a Camera to access them\n- * at a later time.\n- *\n- * Pipeline handlers are expected to extend this base class with platform\n- * specific implementation, associate instances of the derived classes\n- * using the registerCamera() function, and access them at a later time\n- * with cameraData().\n- */\n-\n-/**\n- * \\fn CameraData::CameraData(PipelineHandler *pipe)\n- * \\brief Construct a CameraData instance for the given pipeline handler\n- * \\param[in] pipe The pipeline handler\n- *\n- * The reference to the pipeline handler is stored internally, the caller shall\n- * guarantee that the pointer remains valid as long as the CameraData instance\n- * exists.\n- */\n-\n-/**\n- * \\var CameraData::pipe_\n- * \\brief The pipeline handler related to this CameraData instance\n- *\n- * The pipe_ pointer provides access to the PipelineHandler object that this\n- * instance is related to. It is set when the CameraData instance is created\n- * and remains valid until the instance is destroyed.\n- */\n-\n-/**\n- * \\var CameraData::controlInfo_\n- * \\brief The set of controls supported by the camera\n- *\n- * The control information shall be initialised by the pipeline handler when\n- * creating the camera, and shall not be modified afterwards.\n- */\n-\n-/**\n- * \\var CameraData::properties_\n- * \\brief The list of properties supported by the camera\n- *\n- * The list of camera properties shall be initialised by the pipeline handler\n- * when creating the camera, and shall not be modified afterwards.\n- */\n-\n /**\n * \\class PipelineHandler\n * \\brief Create and manage cameras based on a set of media devices\n@@ -471,28 +422,14 @@ void PipelineHandler::completeRequest(Request *request)\n /**\n * \\brief Register a camera to the camera manager and pipeline handler\n * \\param[in] camera The camera to be added\n- * \\param[in] data Pipeline-specific data for the camera\n *\n * This function is called by pipeline handlers to register the cameras they\n- * handle with the camera manager. It associates the pipeline-specific \\a data\n- * with the camera, for later retrieval with cameraData(). Ownership of \\a data\n- * is transferred to the PipelineHandler.\n+ * handle with the camera manager.\n *\n * \\context This function shall be called from the CameraManager thread.\n */\n-void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,\n-\t\t\t\t std::unique_ptr<CameraData> data)\n+void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)\n {\n-\t/*\n-\t * To be removed once all pipeline handlers will have migrated from\n-\t * CameraData to Camera::Private.\n-\t */\n-\tif (data) {\n-\t\tcamera->_d()->controlInfo_ = std::move(data->controlInfo_);\n-\t\tcamera->_d()->properties_ = std::move(data->properties_);\n-\t}\n-\n-\tcameraData_[camera.get()] = std::move(data);\n \tcameras_.push_back(camera);\n \n \tif (mediaDevices_.empty())\n@@ -586,33 +523,6 @@ void PipelineHandler::disconnect()\n \t}\n }\n \n-/**\n- * \\brief Retrieve the pipeline-specific data associated with a Camera\n- * \\param[in] camera The camera whose data to retrieve\n- * \\return A pointer to the pipeline-specific data passed to registerCamera().\n- * The returned pointer is a borrowed reference and is guaranteed to remain\n- * valid until the pipeline handler is destroyed. It shall not be deleted\n- * manually by the caller.\n- */\n-CameraData *PipelineHandler::cameraData(const Camera *camera)\n-{\n-\tASSERT(cameraData_.count(camera));\n-\treturn cameraData_[camera].get();\n-}\n-\n-/**\n- * \\brief Retrieve the pipeline-specific data associated with a Camera\n- * \\param[in] camera The camera whose data to retrieve\n- * \\sa cameraData()\n- * \\return A const pointer to the pipeline-specific data passed to\n- * registerCamera().\n- */\n-const CameraData *PipelineHandler::cameraData(const Camera *camera) const\n-{\n-\tASSERT(cameraData_.count(camera));\n-\treturn cameraData_.at(camera).get();\n-}\n-\n /**\n * \\var PipelineHandler::manager_\n * \\brief The Camera manager associated with the pipeline handler\n", "prefixes": [ "libcamera-devel", "v3", "11/14" ] }