Show a patch.

GET /api/1.1/patches/13102/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 13102,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13102/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13102/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20210723040036.32346-17-laurent.pinchart@ideasonboard.com>",
    "date": "2021-07-23T04:00:35",
    "name": "[libcamera-devel,RFC,16/17] libcamera: pipeline_handler: Drop CameraData class",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "fc3899eb52dee310de8911b5f718be273b494b1c",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13102/mbox/",
    "series": [
        {
            "id": 2270,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2270/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2270",
            "date": "2021-07-23T04:00:19",
            "name": "libcamera: Replace CameraData with Camera::Private",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2270/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13102/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13102/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 60364C3230\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 23 Jul 2021 04:00:59 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05C57687BF;\n\tFri, 23 Jul 2021 06:00:59 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 411ED687BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Jul 2021 06:00:48 +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 E5431255\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Jul 2021 06:00:47 +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=\"h6Nsz/j1\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1627012848;\n\tbh=P0RGGyqpNqjeuNdwM8q26IofwAflvK3FHu2yiCXmrpw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=h6Nsz/j118LxWhKm1bo3AQtBNwaHseh4E3vhUfSmOWQFlmgiSHAJlU7xVqpR+hCs0\n\tR9d6CBHc2MD1UxHxpDHbEuzZSjH4YAcrxz1atmYH+mZpRatVfJY2pV6758Jgij3oH2\n\thXU448AqjIRz3ixJ8yatSL1fnXwQvp5zEwQxM9iM=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 23 Jul 2021 07:00:35 +0300",
        "Message-Id": "<20210723040036.32346-17-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210723040036.32346-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20210723040036.32346-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 16/17] 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>\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 86727f90bb65..2f814753f2ae 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -8,14 +8,12 @@\n #define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__\n \n #include <list>\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@@ -35,23 +33,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@@ -88,15 +69,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@@ -105,7 +82,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 6d097ac91d2e..713fbec4daae 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -1187,7 +1187,7 @@ int PipelineHandlerIPU3::registerCameras()\n \t\tstd::shared_ptr<Camera> camera =\n \t\t\tCamera::create(data.release(), 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 be8dcdc67a15..895ab3fee329 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1109,7 +1109,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \tconst std::string &id = data->sensor_->id();\n \tstd::shared_ptr<Camera> camera =\n \t\tCamera::create(data.release(), 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 eab892785fb0..22be1a03e4dc 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(data.release(), 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 81d342a3fa73..8594520f520c 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(data.release(), 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 bbeeda97a91a..882d3f82839a 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(data.release(), 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 866c993d7e50..bd7cbcebe3ff 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(data.release(), 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 1f1de19d81c5..28e09bc00771 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() method, 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 method 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",
        "RFC",
        "16/17"
    ]
}