Patch Detail
Show a patch.
GET /api/1.1/patches/13942/?format=api
{ "id": 13942, "url": "https://patchwork.libcamera.org/api/1.1/patches/13942/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13942/", "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": "<20210926212108.22510-3-laurent.pinchart@ideasonboard.com>", "date": "2021-09-26T21:21:08", "name": "[libcamera-devel,3/3] Documentation: application-developer: Add camera detection check", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "93ec595965194841a61920c6836b437e24c5d73b", "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/13942/mbox/", "series": [ { "id": 2571, "url": "https://patchwork.libcamera.org/api/1.1/series/2571/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2571", "date": "2021-09-26T21:21:06", "name": "[libcamera-devel,1/3] Documentation: application-developer: Make global variable static", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2571/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13942/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13942/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 BECA8BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 26 Sep 2021 21:21:22 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 192AB69196;\n\tSun, 26 Sep 2021 23:21:21 +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 B49BE6918C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 26 Sep 2021 23:21:17 +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 565C0EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 26 Sep 2021 23:21:17 +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=\"bgRMjNTY\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1632691277;\n\tbh=TR+ZJaJoSYN3LVeVnSyz1vepTTzQqgphN7g9/FMDlEs=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=bgRMjNTYmDWt44Yyxblp5LGxjSYwkTfAcnBwBfIdpYztUu7fL4GkYBVnMAUxSc+EF\n\t3MqoPNQiPI1V3BxwRECjuJnsz91/EbFnHnr9YiFLrU8fGhoiuEwoXcj8q+PCtt0Vkc\n\tOjO/XAoUvSoLl7qVZdirLNNyjunbtXpz1G5OmS/A=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 27 Sep 2021 00:21:08 +0300", "Message-Id": "<20210926212108.22510-3-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20210926212108.22510-1-laurent.pinchart@ideasonboard.com>", "References": "<20210926212108.22510-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 3/3] Documentation: application-developer:\n\tAdd camera detection check", "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 simple-cam application has a check to ensure that at least one\ncamera is present before attempting to access the first camera, to avoid\na crash. Update the application developer's guide accordingly.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n Documentation/guides/application-developer.rst | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)", "diff": "diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst\nindex 41a7d88369be..11d3df15825b 100644\n--- a/Documentation/guides/application-developer.rst\n+++ b/Documentation/guides/application-developer.rst\n@@ -109,9 +109,16 @@ the Camera Manager reports as available to applications.\n Camera devices are stored by the CameraManager in a list accessible by index, or\n can be retrieved by name through the ``CameraManager::get()`` function. The\n code below retrieves the name of the first available camera and gets the camera\n-by name from the Camera Manager.\n+by name from the Camera Manager, after making sure that at least one camera is\n+available.\n \n .. code:: cpp\n+ if (cm->cameras().empty()) {\n+ std::cout << \"No cameras were identified on the system.\"\n+ << std::endl;\n+ cm->stop();\n+ return EXIT_FAILURE;\n+ }\n \n std::string cameraId = cm->cameras()[0]->id();\n camera = cm->get(cameraId);\n", "prefixes": [ "libcamera-devel", "3/3" ] }