Show a patch.

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

{
    "id": 12525,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12525/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12525/",
    "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": "<20210608151633.73465-4-jacopo@jmondi.org>",
    "date": "2021-06-08T15:16:28",
    "name": "[libcamera-devel,v5,3/8] libcamera: pipeline_handler: Cancel Request on queueing failure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6c7687760c373d8d7302c4c1962313f7d36a3ce1",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/1.1/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/12525/mbox/",
    "series": [
        {
            "id": 2112,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2112/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2112",
            "date": "2021-06-08T15:16:25",
            "name": "Implement flush() camera operation",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2112/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12525/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12525/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 295E3C3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Jun 2021 15:15:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4E79868938;\n\tTue,  8 Jun 2021 17:15:52 +0200 (CEST)",
            "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CBE9602A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Jun 2021 17:15:51 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 469DE60008;\n\tTue,  8 Jun 2021 15:15:50 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  8 Jun 2021 17:16:28 +0200",
        "Message-Id": "<20210608151633.73465-4-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210608151633.73465-1-jacopo@jmondi.org>",
        "References": "<20210608151633.73465-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 3/8] libcamera: pipeline_handler:\n\tCancel Request on queueing failure",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Capture requests are queued by the PipelineHandler base class to each\npipeline handler implementation using the virtual queueRequestDevice()\nfunction.\n\nHowever, if the pipeline handler fails to queue the request to the\nhardware, the request gets silently deleted from the list of queued\nones, without notifying application of the error.\n\nReporting to applications that a Request has failed to queue by\ncancelling and then completing it allows applications to maintain their\nrequest-tracking mechanism consistent with the one internal to the library.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline_handler.cpp | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex f41b7a7b3308..e507a8bba8a6 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -391,6 +391,8 @@ bool PipelineHandler::hasPendingRequests(const Camera *camera) const\n  * This method queues a capture request to the pipeline handler for processing.\n  * The request is first added to the internal list of queued requests, and\n  * then passed to the pipeline handler with a call to queueRequestDevice().\n+ * If the pipeline handler fails in queuing the request to the hardware the\n+ * request is cancelled.\n  *\n  * Keeping track of queued requests ensures automatic completion of all requests\n  * when the pipeline handler is stopped with stop(). Request completion shall be\n@@ -409,8 +411,10 @@ void PipelineHandler::queueRequest(Request *request)\n \trequest->sequence_ = data->requestSequence_++;\n \n \tint ret = queueRequestDevice(camera, request);\n-\tif (ret)\n-\t\tdata->queuedRequests_.remove(request);\n+\tif (ret) {\n+\t\trequest->cancel();\n+\t\tcompleteRequest(request);\n+\t}\n }\n \n /**\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "3/8"
    ]
}