Show a patch.

GET /api/1.1/patches/16521/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 16521,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16521/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16521/",
    "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": "<20220703043704.296872-2-utkarsh02t@gmail.com>",
    "date": "2022-07-03T04:37:02",
    "name": "[libcamera-devel,v4,1/3] qcam: Queue requests only through MainWindow::queueRequest()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "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/16521/mbox/",
    "series": [
        {
            "id": 3244,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3244/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3244",
            "date": "2022-07-03T04:37:01",
            "name": "Introduce capture scripts to qcam",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3244/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16521/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16521/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 6D040BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  3 Jul 2022 04:37:17 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B681D65652;\n\tSun,  3 Jul 2022 06:37:15 +0200 (CEST)",
            "from mail-pl1-x630.google.com (mail-pl1-x630.google.com\n\t[IPv6:2607:f8b0:4864:20::630])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A6EE56564A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  3 Jul 2022 06:37:14 +0200 (CEST)",
            "by mail-pl1-x630.google.com with SMTP id l12so451297plk.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 02 Jul 2022 21:37:14 -0700 (PDT)",
            "from localhost.localdomain\n\t([2406:3003:2005:1c27:2dd0:3b05:f874:d165])\n\tby smtp.gmail.com with ESMTPSA id\n\tme3-20020a17090b17c300b001ec84b0f199sm12122299pjb.1.2022.07.02.21.37.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 02 Jul 2022 21:37:12 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656823035;\n\tbh=Slu+O+fZW1w4jednfVozuSqsmmLjs5PiAl0EhrINfMU=;\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=yCdE0YcKuHqS1BO406ULif+RtSOg83/O0rX5LUercDpW6ZI1DNVL1PoI/E2LD1FFj\n\tKj7/YLaEuph3Cz6luL6O/HZ3n0dY+4/luVlyfXo/1NgHxgbdcqFmqVnq3PT4NdEbwS\n\tPp3G5wSb8Ld+t5Z+yKUWMnrKRtYPECacPz7RCuUjxrIVQmpTAN8i8XGFWxJqjRuxj6\n\t+4HIxeKzSEAJ5YSJg9msK/Hm0/KIK8BTsezbD4IMFZbPKf6TjLmzGhHmh2TZPHFJ5l\n\tlQKG9+YB9MnKcURwsYN02qDvedI/C1dFeKzGW6Ci3cOI3ABXjw1F6qr5N+fVy3AFXo\n\tarQOlY3DLNgmw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=wDcETgwSinFLReuS0BeWAkYv37eRLN/VM7Si6XYDqn0=;\n\tb=NsOHUnP5fOTH+Vu00ea4Nt4iNn88uHWq8clAv9LfpHm92ZzRjjkhNYpLDLxPEbGuGJ\n\tr7MZpyt1/vpjDNbSyWDOhZOUzYhATAmnktv5EQFd0MInQTsNTkozEV0Mv8Ag+SeN2JpO\n\t4kHMwDSfkA4TNI5EP0BydwxrgBJ4ib1Kna1eBdPZrcM3r0xiGBKmOro+VePvvj7hMOm/\n\tbmmX2kpotSG5bGKLHX+yypHkmqq2ZkEaGjoxRr5lyIyW9606ZIn/HuQa4JjwVo9AOiwh\n\tlu2RjREKCG+vrUcA9R26plkXXCI/EPVOqTDw5Cc8PlCjyE+3qoJFABrPkMTWO9IlvW6v\n\tzRMg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"NsOHUnP5\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=wDcETgwSinFLReuS0BeWAkYv37eRLN/VM7Si6XYDqn0=;\n\tb=mxiuu9F17K8KsWaZ/0CcvNheU+1R36r5VFbB1RYALI/9o4L3xMeh4CSV8PPOwQVvZC\n\tE1yhlqRAAVKNPBZa4QA6JUtgdseKw5mraT0qyoF+OL5LlOPsya+6o80IIoq6fMU2wB8L\n\tToxomR1LL4uwlixZAD1UA5BLzN2wnd5fIf7a7WkLWjexELYrJSTm5YYus/Dy2+82BpLX\n\tdDnhKKx2C6o5rl/3XlyB2CJzGMnaxSyaf13f9A35JLGYcxIijgTlq+pqrtTbXdrjdGrB\n\tKl+Sjk5NucA7qaBwcTiJF/kltJgjz09dVU6MRVudulYuWn0THb8Pi8pNCRrM2vCZ6Pdb\n\tDJnA==",
        "X-Gm-Message-State": "AJIora+OVvwg9G1mRge94hBCAx0OikkBW9ty6AxYR8V8Nwh9lPRfDkrB\n\tTdVT8RhhvofqQoblIGfiGb7YJbyQhVktxQ==",
        "X-Google-Smtp-Source": "AGRyM1t84bBwTKRtbknJpPQgMr5qi5r7kKVgfEWxv3g0lFXRvjSFA8k2n/zvfJKbmlrEsim2Zfh0rw==",
        "X-Received": "by 2002:a17:902:ec89:b0:16a:2a7d:5efa with SMTP id\n\tx9-20020a170902ec8900b0016a2a7d5efamr30328820plg.114.1656823032858; \n\tSat, 02 Jul 2022 21:37:12 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sun,  3 Jul 2022 12:37:02 +0800",
        "Message-Id": "<20220703043704.296872-2-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220703043704.296872-1-utkarsh02t@gmail.com>",
        "References": "<20220703043704.296872-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 1/3] 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 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>\n---\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 dd0e51f5..adeb3181 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@@ -521,7 +521,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@@ -755,7 +755,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@@ -784,6 +784,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 3fbe872c..c3e4b665 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -66,7 +66,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@@ -80,6 +80,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",
        "v4",
        "1/3"
    ]
}