Patch Detail
Show a patch.
GET /api/patches/8966/?format=api
{ "id": 8966, "url": "https://patchwork.libcamera.org/api/patches/8966/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8966/", "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": "<20200724134320.637696-3-niklas.soderlund@ragnatech.se>", "date": "2020-07-24T13:43:19", "name": "[libcamera-devel,2/3] cam: capture: Cache the EventLoop handler", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ba36dbd12b315580ea401f1436d4471330f42984", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/8966/mbox/", "series": [ { "id": 1136, "url": "https://patchwork.libcamera.org/api/series/1136/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1136", "date": "2020-07-24T13:43:17", "name": "cam: Add options to make batch testing with cam easier", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1136/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8966/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8966/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 580C5BD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jul 2020 13:43:34 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33E5161243;\n\tFri, 24 Jul 2020 15:43:32 +0200 (CEST)", "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B55AE60535\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2020 15:43:30 +0200 (CEST)", "from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid a895f877-cdb3-11ea-8fb8-005056917f90;\n\tFri, 24 Jul 2020 15:43:30 +0200 (CEST)" ], "X-Halon-ID": "a895f877-cdb3-11ea-8fb8-005056917f90", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 24 Jul 2020 15:43:19 +0200", "Message-Id": "<20200724134320.637696-3-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200724134320.637696-1-niklas.soderlund@ragnatech.se>", "References": "<20200724134320.637696-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 2/3] cam: capture: Cache the EventLoop\n\thandler", "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>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Prepare for the ability to exit the event loop based on conditions in\nthe request complete handler by caching the pointer instead of passing\nit as an argument.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/cam/capture.cpp | 10 ++++++----\n src/cam/capture.h | 5 +++--\n 2 files changed, 9 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\nindex 55fa2dabcee97f21..aa53c407d7b71b44 100644\n--- a/src/cam/capture.cpp\n+++ b/src/cam/capture.cpp\n@@ -17,7 +17,7 @@\n using namespace libcamera;\n \n Capture::Capture(std::shared_ptr<Camera> camera, CameraConfiguration *config)\n-\t: camera_(camera), config_(config), writer_(nullptr)\n+\t: camera_(camera), config_(config), writer_(nullptr), loop_(nullptr)\n {\n }\n \n@@ -25,6 +25,8 @@ int Capture::run(EventLoop *loop, const OptionsParser::Options &options)\n {\n \tint ret;\n \n+\tloop_ = loop;\n+\n \tif (!camera_) {\n \t\tstd::cout << \"Can't capture without a camera\" << std::endl;\n \t\treturn -ENODEV;\n@@ -54,7 +56,7 @@ int Capture::run(EventLoop *loop, const OptionsParser::Options &options)\n \n \tFrameBufferAllocator *allocator = new FrameBufferAllocator(camera_);\n \n-\tret = capture(loop, allocator);\n+\tret = capture(allocator);\n \n \tif (options.isSet(OptFile)) {\n \t\tdelete writer_;\n@@ -66,7 +68,7 @@ int Capture::run(EventLoop *loop, const OptionsParser::Options &options)\n \treturn ret;\n }\n \n-int Capture::capture(EventLoop *loop, FrameBufferAllocator *allocator)\n+int Capture::capture(FrameBufferAllocator *allocator)\n {\n \tint ret;\n \n@@ -132,7 +134,7 @@ int Capture::capture(EventLoop *loop, FrameBufferAllocator *allocator)\n \t}\n \n \tstd::cout << \"Capture until user interrupts by SIGINT\" << std::endl;\n-\tret = loop->exec();\n+\tret = loop_->exec();\n \tif (ret)\n \t\tstd::cout << \"Failed to run capture loop\" << std::endl;\n \ndiff --git a/src/cam/capture.h b/src/cam/capture.h\nindex 9bca5661070efcf5..67c6260bfe24aefc 100644\n--- a/src/cam/capture.h\n+++ b/src/cam/capture.h\n@@ -28,8 +28,7 @@ public:\n \n \tint run(EventLoop *loop, const OptionsParser::Options &options);\n private:\n-\tint capture(EventLoop *loop,\n-\t\t libcamera::FrameBufferAllocator *allocator);\n+\tint capture(libcamera::FrameBufferAllocator *allocator);\n \n \tvoid requestComplete(libcamera::Request *request);\n \n@@ -39,6 +38,8 @@ private:\n \tstd::map<libcamera::Stream *, std::string> streamName_;\n \tBufferWriter *writer_;\n \tstd::chrono::steady_clock::time_point last_;\n+\n+\tEventLoop *loop_;\n };\n \n #endif /* __CAM_CAPTURE_H__ */\n", "prefixes": [ "libcamera-devel", "2/3" ] }