Patch Detail
Show a patch.
GET /api/1.1/patches/17071/?format=api
{ "id": 17071, "url": "https://patchwork.libcamera.org/api/1.1/patches/17071/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17071/", "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": "<20220810150349.414043-6-utkarsh02t@gmail.com>", "date": "2022-08-10T15:03:46", "name": "[libcamera-devel,v8,5/8] 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/17071/mbox/", "series": [ { "id": 3402, "url": "https://patchwork.libcamera.org/api/1.1/series/3402/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3402", "date": "2022-08-10T15:03:41", "name": "Introduce capture scripts to qcam", "version": 8, "mbox": "https://patchwork.libcamera.org/series/3402/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17071/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17071/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 20681C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 15:04:11 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B66796333B;\n\tWed, 10 Aug 2022 17:04:10 +0200 (CEST)", "from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com\n\t[IPv6:2607:f8b0:4864:20::102c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 82C686332F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 17:04:08 +0200 (CEST)", "by mail-pj1-x102c.google.com with SMTP id\n\tt2-20020a17090a4e4200b001f21572f3a4so2417614pjl.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 08:04:08 -0700 (PDT)", "from localhost.localdomain ([2404:bd00:3:d2bc:2a55:4cae:bf8f:f4ed])\n\tby smtp.gmail.com with ESMTPSA id\n\tb3-20020a1709027e0300b0016f1319d2a7sm12882624plm.297.2022.08.10.08.04.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Aug 2022 08:04:05 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660143850;\n\tbh=eMQ9fTcDsbdhogqD9GzzYdsP7fFmYYdw8BiNGR78NOQ=;\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=z91wrlZrFyKzjGrmEWiC0MreoolpuLDLcKdcCW6eAKpIs1kSGBOdXnqspxgLMMsr8\n\tFFOalW28ZLFC4BG5QohI5+L3R48YhEedgpXtavRTbbqIcmDXcCMiDbZlQSq5kh7Kr1\n\tlvMDrcCD2nqF6HSeR+C87Sql9rLM9NcLLvC+6FPw6bI4YaUayWquCgvi660xtocHa9\n\t/Uyzclj29iCb4Y9HcLjHEvMgAtW+qiPCXc4xQ0tCfcZNGhWVXHzJADuSOgBuKm7Y5V\n\tUIjmyC2aLyjdVSu7G35HvfIwHXcSaQOI4UhvYXRKgUJQQIBIfSX5Ydzkt6L5N++LA3\n\tV1EhozPegZNXg==", "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=nah3tKvUMmyz1awvcvaknd4JXs71eyge+DgPppV+IVA=;\n\tb=UWElb8oXNcTh/kt8skmCKYAnMPCNyNAhRYynNzJstps3OkjONlI2nKK7UvyaaMi1cq\n\to1tckfPNTGKuuD4UgFLTwdAAuq34Vt3oz1yA97ZeaDcm7hac9gcRZCGNLADhPxtT64pz\n\tTxDBX6esrfFyApeyhBsuv34dv6sjFqRy1qFFj5XuXZPnI88DE/S93FahwbJlR2UoxOj8\n\tLIz38yed4yK8Zum9P6NB1iyz8e/vKhCj3RSu53o5678UkFFAE4jbCGYOhpGBAuSY49JB\n\tz7prbLGo8eN7qUzuS8Ba+SiwMLe7aFQhcEAG7G6gWKnscLso9BZb2PK08SiV525af6im\n\t8ouA==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"UWElb8oX\"; 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=nah3tKvUMmyz1awvcvaknd4JXs71eyge+DgPppV+IVA=;\n\tb=iBJ54U94gViO4ILnAtDSymC2GaAEiSENiuF3H2sPGDfzTnW5lujb8kmIHuipfn1vvJ\n\tn5Vx5TlBJCI4cK0OjZkXV5DnArnDaY5BeXvebop52IRCIjgD6Fn/+sxNuJzYdfoTxvNC\n\tEgYzXisKh20X25gFjMqdu/vU0a2CusiTYntt1+3uCocYXtDrHME/nb8wP9C4NLrP+nD2\n\t1Sxoxws+S9yWB98/nzsZNwGakU9G7lOLu4u+Gys08BA8RG7WkAZSRCEMNEBdtQY2RrSw\n\tGkIQQlx/1QJB2tZ/w9SZAaBWgsczPAmobEZRjDpEkWTZFXvNRKcIzGiD7eFybJYkgWLM\n\tbqrw==", "X-Gm-Message-State": "ACgBeo1D2DmDwDKoCU98fi9rMlp19W+KyYj3pxxkgkr4U3DU9jUH8fR3\n\t89uB7PaxzNt9t8FM2AaeiY8Ofns5ZGU=", "X-Google-Smtp-Source": "AA6agR6lrHDQyN5Pow4I0NESyCE6bDfs3qGCQMQKobdWLnhvkwcfPYFQQgXqM64DKZlLpepFcKSFrg==", "X-Received": "by 2002:a17:90b:4b46:b0:1f7:2430:2286 with SMTP id\n\tmi6-20020a17090b4b4600b001f724302286mr4091340pjb.138.1660143846788; \n\tWed, 10 Aug 2022 08:04:06 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 10 Aug 2022 20:33:46 +0530", "Message-Id": "<20220810150349.414043-6-utkarsh02t@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220810150349.414043-1-utkarsh02t@gmail.com>", "References": "<20220810150349.414043-1-utkarsh02t@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v8 5/8] 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---\nDifference from v7:\n\t1. Nothing (the only perfect patch)\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 d1b8d2dd..bf40572a 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -121,14 +121,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@@ -517,7 +517,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@@ -749,7 +749,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@@ -778,6 +778,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 f9ea8bd3..d161365a 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", "v8", "5/8" ] }