Patch Detail
Show a patch.
GET /api/1.1/patches/13235/?format=api
{ "id": 13235, "url": "https://patchwork.libcamera.org/api/1.1/patches/13235/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13235/", "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": "<20210805222436.6263-5-laurent.pinchart@ideasonboard.com>", "date": "2021-08-05T22:24:30", "name": "[libcamera-devel,04/10] libcamera: pipeline: simple: Store video node entity in camera data", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "335ebe2356249ce193bc5656450829236d17913c", "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/13235/mbox/", "series": [ { "id": 2314, "url": "https://patchwork.libcamera.org/api/1.1/series/2314/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2314", "date": "2021-08-05T22:24:26", "name": "Concurrent camera support in simple pipeline handler", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2314/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13235/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13235/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 4F5BDC3239\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 5 Aug 2021 22:25:03 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B0CB6888E;\n\tFri, 6 Aug 2021 00:25:00 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 244AC6880D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 6 Aug 2021 00:24:57 +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 AEFCBE1A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 6 Aug 2021 00:24:56 +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=\"V/G+tvud\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628202296;\n\tbh=EI8EOkLoNvotyI11OoGreFBjJlAWkJbuG/qu6UTgkS0=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=V/G+tvud1zrNZWX7+63z+pPa3dqWx916hz/BYZqREQmIjBXjxi6pDcfnkjqSSHRDJ\n\tkfZ3pPt6fEpm85keAmTfQCDTH5rERc085mXAE4muzFk4/dZXFWM5rII4cBbQfPNlxI\n\tiH1s0e7TI4Hzg6r7NSQDjvI1Rm0IZpd5Cn59mvuY=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 6 Aug 2021 01:24:30 +0300", "Message-Id": "<20210805222436.6263-5-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20210805222436.6263-1-laurent.pinchart@ideasonboard.com>", "References": "<20210805222436.6263-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 04/10] libcamera: pipeline: simple: Store\n\tvideo node entity in camera data", "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": "Store the entity corresponding to the video node at the end of the\npipeline in the SimpleCameraData::entities_ list. This requires special\nhandling of the video node in the loops that iterate over all entities,\nbut will be useful to implement mutually exclusive access to entities\nfor concurrent camera usage.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 29 ++++++++++++++++++++----\n 1 file changed, 24 insertions(+), 5 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 744f842dbfe6..99ecd640349c 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -194,8 +194,13 @@ public:\n \t};\n \n \tstd::vector<Stream> streams_;\n-\tstd::unique_ptr<CameraSensor> sensor_;\n+\n+\t/*\n+\t * All entities in the pipeline, from the camera sensor to the video\n+\t * node.\n+\t */\n \tstd::list<Entity> entities_;\n+\tstd::unique_ptr<CameraSensor> sensor_;\n \tV4L2VideoDevice *video_;\n \n \tstd::vector<Configuration> configs_;\n@@ -309,12 +314,11 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \tstd::unordered_map<MediaEntity *, Entity> parents;\n \tMediaEntity *entity = nullptr;\n \tMediaEntity *video = nullptr;\n+\tMediaPad *sinkPad;\n \n \tqueue.push({ sensor, nullptr });\n \n \twhile (!queue.empty()) {\n-\t\tMediaPad *sinkPad;\n-\n \t\tstd::tie(entity, sinkPad) = queue.front();\n \t\tqueue.pop();\n \n@@ -347,8 +351,11 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \n \t/*\n \t * With the parents, we can follow back our way from the capture device\n-\t * to the sensor.\n+\t * to the sensor. Store all the entities in the pipeline, from the\n+\t * camera sensor to the video node, in entities_.\n \t */\n+\tentities_.push_front({ entity, sinkPad, nullptr, nullptr });\n+\n \tfor (auto it = parents.find(entity); it != parents.end();\n \t it = parents.find(entity)) {\n \t\tconst Entity &e = it->second;\n@@ -484,6 +491,9 @@ int SimpleCameraData::setupLinks()\n \t * want to enable) before enabling the pipeline link.\n \t */\n \tfor (SimpleCameraData::Entity &e : entities_) {\n+\t\tif (!e.link)\n+\t\t\tbreak;\n+\n \t\tMediaEntity *remote = e.link->sink()->entity();\n \t\tfor (MediaPad *pad : remote->pads()) {\n \t\t\tfor (MediaLink *link : pad->links()) {\n@@ -524,6 +534,9 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n \t\treturn ret;\n \n \tfor (const Entity &e : entities_) {\n+\t\tif (!e.link)\n+\t\t\tbreak;\n+\n \t\tMediaLink *link = e.link;\n \t\tMediaPad *source = link->source();\n \t\tMediaPad *sink = link->sink();\n@@ -1050,8 +1063,14 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \tif (entities.empty())\n \t\treturn false;\n \n-\t/* Create and open V4L2Subdev instances for all the entities. */\n+\t/*\n+\t * Create and open V4L2Subdevice instances for all entities\n+\t * corresponding to a V4L2 subdevice.\n+\t */\n \tfor (MediaEntity *entity : entities) {\n+\t\tif (entity->type() != MediaEntity::Type::V4L2Subdevice)\n+\t\t\tcontinue;\n+\n \t\tauto elem = subdevs_.emplace(std::piecewise_construct,\n \t\t\t\t\t std::forward_as_tuple(entity),\n \t\t\t\t\t std::forward_as_tuple(entity));\n", "prefixes": [ "libcamera-devel", "04/10" ] }