Patch Detail
Show a patch.
GET /api/1.1/patches/17269/?format=api
{ "id": 17269, "url": "https://patchwork.libcamera.org/api/1.1/patches/17269/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17269/", "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": "<20220831054938.21617-6-utkarsh02t@gmail.com>", "date": "2022-08-31T05:49:36", "name": "[libcamera-devel,v9,5/7] qcam: Queue requests only through MainWindow::queueRequest()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "bbc350001fa86beee4bea0c7bf20251307f63765", "submitter": { "id": 114, "url": "https://patchwork.libcamera.org/api/1.1/people/114/?format=api", "name": "Utkarsh Tiwari", "email": "utkarsh02t@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17269/mbox/", "series": [ { "id": 3457, "url": "https://patchwork.libcamera.org/api/1.1/series/3457/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3457", "date": "2022-08-31T05:49:31", "name": "Introduce capture scripts to qcam", "version": 9, "mbox": "https://patchwork.libcamera.org/series/3457/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17269/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17269/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 79098C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 31 Aug 2022 05:50:08 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 21BB161FC7;\n\tWed, 31 Aug 2022 07:50:08 +0200 (CEST)", "from mail-pg1-x536.google.com (mail-pg1-x536.google.com\n\t[IPv6:2607:f8b0:4864:20::536])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A20F661F9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 31 Aug 2022 07:50:06 +0200 (CEST)", "by mail-pg1-x536.google.com with SMTP id f4so12610075pgc.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Aug 2022 22:50:06 -0700 (PDT)", "from devut-HP-Laptop-14q-cs0xxx.. ([103.36.82.122])\n\tby smtp.gmail.com with ESMTPSA id\n\tq19-20020aa79833000000b00537eacc8fa6sm8307333pfl.40.2022.08.30.22.50.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 30 Aug 2022 22:50:04 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661925008;\n\tbh=fXoMlk6sgHoLEmRpFy57e1Hx90cBeYwS6e11OGTXJAQ=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=GI3LsYOZ2WVFTuekhD+1vRyb8O8tir/UHn6jDYU1Fi7tyIxZJJWnrkqKaV6SRKCRh\n\tx51dxV4cXDgLicbRjF64hcLD63F6hZGFNReQ3qHDQXqWoFsB4Us5m6m7R944LlNq6s\n\tt547dJwx7dka1w5p71P3mXrZcVuTIHd/vOKHJdn10OPzp5/ZdoblZYCyK4DyoGxemX\n\t6Wo2xNHKDmEvctzw9ePJ7OJ7BT1IijMW/YCFB42M7Z95116v+/8J0Fvdq0bfm/vmkI\n\tHd7uYg6+bl1iphI1M1pY7HwGN7TWrLq23oIkNj1a7A5WtIBHW3BFIXswPwnWVNXPr/\n\tWuIpKF2ZIwaow==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=K8djUDQAO1qcatMQ0yfPTxbPOky+Dev0DXfz/BLLymk=;\n\tb=HJDo1rkE4k4FhO9gs5wM7H23G8ABRYh1Tt5TnVSVVSSHsnamv/CqIVJ7MrlibRkxM8\n\tfrB3kl6uPR2VXs0ubZ6PAT1Sdn8rdUjR9V68hcWk8Gy3+/3djs3KS84YwClrcoha1QQs\n\toFnaVSsIA05iIRZYsNPk6CPM/mYv/MDopvwoBxDOhlDYsyqDSqIdj4scCA52Npgn7ZMI\n\tpOQz75JX5WMykHfdd99ViXztIn0yvsWIt/h5xRRANN+jVFB5/U5Wg/8oV+qc/kwBqKma\n\tKXdm9crMwiV3Jb75Q36hjv1uAK0n98cl3vizuJOMY7RIE2mamdPUPa2bc8OXhcc7+jXH\n\tpxtw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"HJDo1rkE\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=K8djUDQAO1qcatMQ0yfPTxbPOky+Dev0DXfz/BLLymk=;\n\tb=do+KW0b6DAW+Z7CBaifY0N9O8z1W+jW6pLiHkTCwES+zPaFuyNpjCGVmi/KQnb2eOM\n\tmz90TD/k/8w6LESvMp54uoTuO8iRHpdW01fsOvHSD6Z3mBs+FCbwuyb79Af8fwJeAkq6\n\tGdIHm4B33pe6hA8AAct2y1IRcdjgQRE9JkYhMvo+1SD2oS+hXsYyT9JrEq72SFKIXYq5\n\t1dgyPYJgRYdv9do7mueHSPqwmCNPT4baEKYyX0PRBHS13zr/Z2QAwEaVfI4I+E9jx9R1\n\teXOJ9zckrzaWZqu9C6JLFK2R0CIgEiC/Caa0EX7LhIrdbcBgf8hsbyr3r4AZKfFzPsFE\n\tuP4A==", "X-Gm-Message-State": "ACgBeo01TtQFiA82ciiDQm5twBBAiaBhvAcZJKZ/QkJ/zxTREIm1QwGo\n\tW6BLjNHBmUhSUNlz4eUMbkrbJcFGgIY=", "X-Google-Smtp-Source": "AA6agR4fuwry5k7sidZOfIHHqM9wUJ/ai6Z3pjpJeNwd7i3K9oAFSY2Pjht56YDRJfhvv21xvmM++Q==", "X-Received": "by 2002:a63:91c1:0:b0:42b:50f8:774c with SMTP id\n\tl184-20020a6391c1000000b0042b50f8774cmr20821571pge.496.1661925005109; \n\tTue, 30 Aug 2022 22:50:05 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 31 Aug 2022 11:19:36 +0530", "Message-Id": "<20220831054938.21617-6-utkarsh02t@gmail.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20220831054938.21617-1-utkarsh02t@gmail.com>", "References": "<20220831054938.21617-1-utkarsh02t@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v9 5/7] qcam: Queue requests only through\n\tMainWindow::queueRequest()", "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>", "From": "Utkarsh Tiwari via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Utkarsh Tiwari <utkarsh02t@gmail.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Currently to request a frame, we operate the camera directly.\nThis approach is also scattered in two places,\nMainWindow::startCapture() and MainWindow::queueRequest().\nThis makes it difficult to account for requests.\n\nCentralize all the queuing to a single function queueRequest()\n\nRename the current queueRequest() to renderComplete().\nThis makes more sense as this slot is triggered when\nthe render is complete and we want to queue another\nrequest.\n\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n Difference from v8:\n 1. None :D\n src/qcam/main_window.cpp | 14 +++++++++-----\n src/qcam/main_window.h | 3 ++-\n 2 files changed, 11 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 505bdc56..2a9ca830 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -119,14 +119,14 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)\n \tif (renderType == \"qt\") {\n \t\tViewFinderQt *viewfinder = new ViewFinderQt(this);\n \t\tconnect(viewfinder, &ViewFinderQt::renderComplete,\n-\t\t\tthis, &MainWindow::queueRequest);\n+\t\t\tthis, &MainWindow::renderComplete);\n \t\tviewfinder_ = viewfinder;\n \t\tsetCentralWidget(viewfinder);\n #ifndef QT_NO_OPENGL\n \t} else if (renderType == \"gles\") {\n \t\tViewFinderGL *viewfinder = new ViewFinderGL(this);\n \t\tconnect(viewfinder, &ViewFinderGL::renderComplete,\n-\t\t\tthis, &MainWindow::queueRequest);\n+\t\t\tthis, &MainWindow::renderComplete);\n \t\tviewfinder_ = viewfinder;\n \t\tsetCentralWidget(viewfinder);\n #endif\n@@ -510,7 +510,7 @@ int MainWindow::startCapture()\n \n \t/* Queue all requests. */\n \tfor (std::unique_ptr<Request> &request : requests_) {\n-\t\tret = camera_->queueRequest(request.get());\n+\t\tret = queueRequest(request.get());\n \t\tif (ret < 0) {\n \t\t\tqWarning() << \"Can't queue request\";\n \t\t\tgoto error_disconnect;\n@@ -743,7 +743,7 @@ void MainWindow::processViewfinder(FrameBuffer *buffer)\n \tviewfinder_->render(buffer, mappedBuffers_[buffer].get());\n }\n \n-void MainWindow::queueRequest(FrameBuffer *buffer)\n+void MainWindow::renderComplete(FrameBuffer *buffer)\n {\n \tRequest *request;\n \t{\n@@ -772,6 +772,10 @@ void MainWindow::queueRequest(FrameBuffer *buffer)\n \t\t\tqWarning() << \"No free buffer available for RAW capture\";\n \t\t}\n \t}\n+\tqueueRequest(request);\n+}\n \n-\tcamera_->queueRequest(request);\n+int MainWindow::queueRequest(Request *request)\n+{\n+\treturn camera_->queueRequest(request);\n }\ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex 79723256..22c85247 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -69,7 +69,7 @@ private Q_SLOTS:\n \tvoid processRaw(libcamera::FrameBuffer *buffer,\n \t\t\tconst libcamera::ControlList &metadata);\n \n-\tvoid queueRequest(libcamera::FrameBuffer *buffer);\n+\tvoid renderComplete(libcamera::FrameBuffer *buffer);\n \n private:\n \tint createToolbars();\n@@ -83,6 +83,7 @@ private:\n \tvoid addCamera(std::shared_ptr<libcamera::Camera> camera);\n \tvoid removeCamera(std::shared_ptr<libcamera::Camera> camera);\n \n+\tint queueRequest(libcamera::Request *request);\n \tvoid requestComplete(libcamera::Request *request);\n \tvoid processCapture();\n \tvoid processHotplug(HotplugEvent *e);\n", "prefixes": [ "libcamera-devel", "v9", "5/7" ] }