Show a patch.

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

{
    "id": 17019,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17019/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17019/",
    "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": "<20220807203204.152358-2-utkarsh02t@gmail.com>",
    "date": "2022-08-07T20:32:01",
    "name": "[libcamera-devel,v6,1/4] 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/17019/mbox/",
    "series": [
        {
            "id": 3385,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3385/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3385",
            "date": "2022-08-07T20:32:00",
            "name": "Introduce capture scripts to qcam",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/3385/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17019/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17019/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 2E500BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  7 Aug 2022 20:32:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DB0EF63329;\n\tSun,  7 Aug 2022 22:32:23 +0200 (CEST)",
            "from mail-pf1-x430.google.com (mail-pf1-x430.google.com\n\t[IPv6:2607:f8b0:4864:20::430])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 97F4463327\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  7 Aug 2022 22:32:22 +0200 (CEST)",
            "by mail-pf1-x430.google.com with SMTP id k14so4502609pfh.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 07 Aug 2022 13:32:22 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:8eec:115d:8ea8:b700])\n\tby smtp.gmail.com with ESMTPSA id\n\tx29-20020aa7941d000000b0052d194a6602sm7006334pfo.102.2022.08.07.13.32.18\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 07 Aug 2022 13:32:20 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659904343;\n\tbh=c4VuuPECAHqtJT0jZXC2FUT3ZP7jseExejACAso5SdI=;\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=2AjKtwU9a4+Qy+v0QDn+eL7HPXgbR4uza8xMIyjm6284Or4e6iZOjIs9Yo+7SiYhT\n\t9hHtHsYGHnB1q8o/WBcQMgh+2+gSUl59aiaQYc8wRpV0Wf/tnJV6mXaaCWjfC3Rlvt\n\t37PFwwYsY5IVsMrtNr6hkv40BDCRClb9ntpRL/tzN+X3vUAunzG1JscI8fEoX61hy/\n\tI8FHfIiSJl7qYH2AijY+dBixtRlYOV2WsUybJtnX/C11TNx9SWM7ry1zImEm76VQDu\n\tVl218CBBCF28PS3W3hH92fJcojsqcPTMKJOeO9Zfq/LWjL9cASx/Pe4I64BcZNVswl\n\t1pphgihSZF+rQ==",
            "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=1BAur522nDly0wmsL7dBqSiwB12eYFtaaqg3Af9dIEk=;\n\tb=n2q9B0ToNkbzUsEf2cGg25IGvU0FT3BMOIy5dIgbrEWi1NLTRcHbT2Xgd1ZiLdJkCM\n\tw2uegcMa5Zr2bUzyhjIkJ7g1CSx8aReyh+T+eRzxCsyoMS/PneU5gbLN+OxZ7NC76q2f\n\tjjLeHt5ROh80+tDg3gQuRdkANPLeoEITg1p9yuCnhIIpwHl9Zv5IckC3I2YIwC3ulXg8\n\t4HWDPu+CaX0HlA5mL3o+5s8hmwpPsSKpXm6PEeUe3I6AUJz8qPextkjxZ74YfHhOmUso\n\tPWcSVW5/XXvdLFH/2y6ydo5y6kfmfZMGHp4FWpU4GvSO2ywthaUUUijgF9vReK7zoYFz\n\tr8+g=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"n2q9B0To\"; 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=1BAur522nDly0wmsL7dBqSiwB12eYFtaaqg3Af9dIEk=;\n\tb=Fue6DYMr0wNC8GbT7Xzrsm9tJFalIaZlSnVUZhNVHCtdiLa3gBibG4EsJEqJO7yu7Q\n\tbTY81IczDk/OSsGYdUE67QOzqlK97UBLANBZCxH5Dhv1MtO+nrkR8SnbpSzFGBj7YB6C\n\try6J/h6FRwSv9LA+TnHWK/Dqsy/BgVjrQQhCYVdjG+C8qYPY021J1XxJkPK3NRGl5uIN\n\tUl3JSkwN1WJ05RcwN8y4zMqeX/Jri+HR+0zwVmu8KUjL+HiqI3lbEC8S7qgX9WOacOAF\n\t3lvvHwSvSp0MnN9vYenNkYFMt4Wnbg/YCt6iQIIZ0Xypt1Zl6IWJZCE5l5okhElSGY/P\n\tJfXg==",
        "X-Gm-Message-State": "ACgBeo13ssapx+6Jk2usLH9w/JbFu3fs3v+MieRuNOaZtXAfyyd/yg0g\n\tRYLxvh/yz473k7vh6xIGUrDEkEQRoxw=",
        "X-Google-Smtp-Source": "AA6agR5WFh/bDOLdxeZzjIfcFpHonFrF6sNDrSssfonQQtR7hnwjIxOozkJRQD3P5XKuVkS+JY2f1A==",
        "X-Received": "by 2002:a63:f54:0:b0:41b:a215:cb4b with SMTP id\n\t20-20020a630f54000000b0041ba215cb4bmr12849699pgp.529.1659904340754; \n\tSun, 07 Aug 2022 13:32:20 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  8 Aug 2022 02:02:01 +0530",
        "Message-Id": "<20220807203204.152358-2-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220807203204.152358-1-utkarsh02t@gmail.com>",
        "References": "<20220807203204.152358-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v6 1/4] 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>\n---\nDifference from v1:\n\tNo changes\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 98c22b71..549af024 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -120,14 +120,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@@ -515,7 +515,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 fe0f5938..7982939e 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -70,7 +70,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@@ -84,6 +84,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",
        "v6",
        "1/4"
    ]
}