Show a patch.

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

{
    "id": 997,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/997/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/997/",
    "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": "<20190415231859.9747-5-jacopo@jmondi.org>",
    "date": "2019-04-15T23:18:56",
    "name": "[libcamera-devel,v5,4/7] libcamera: request: Add empty() method",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "730a85a4ab9ca652cd6c7d33601bcb22dd4e5476",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/997/mbox/",
    "series": [
        {
            "id": 251,
            "url": "https://patchwork.libcamera.org/api/1.1/series/251/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=251",
            "date": "2019-04-15T23:18:52",
            "name": "libcamera: Framework changes to prepare for multiple streams support",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/251/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/997/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/997/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65D3660DC3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2019 01:18:21 +0200 (CEST)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id BF5701BF205;\n\tMon, 15 Apr 2019 23:18:20 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 16 Apr 2019 01:18:56 +0200",
        "Message-Id": "<20190415231859.9747-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190415231859.9747-1-jacopo@jmondi.org>",
        "References": "<20190415231859.9747-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 4/7] libcamera: request: Add empty()\n\tmethod",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Mon, 15 Apr 2019 23:18:22 -0000"
    },
    "content": "Add method to verify if a request has pending buffers yet to be\ncompleted or it is empty and ready from completion.\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/request.h |  2 ++\n src/libcamera/request.cpp   | 11 +++++++++--\n 2 files changed, 11 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/libcamera/request.h b/include/libcamera/request.h\nindex 0dbd425115e8..6f97aa177ae0 100644\n--- a/include/libcamera/request.h\n+++ b/include/libcamera/request.h\n@@ -37,6 +37,8 @@ public:\n \n \tStatus status() const { return status_; }\n \n+\tbool empty() const { return pending_.empty(); }\n+\n private:\n \tfriend class Camera;\n \tfriend class PipelineHandler;\ndiff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex e0e77e972411..33055c5ac533 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -106,6 +106,13 @@ Buffer *Request::findBuffer(Stream *stream) const\n  * \\return The request completion status\n  */\n \n+/**\n+ * \\fn Request::empty()\n+ * \\brief Retrieve if a request has buffers yet to be completed\n+ *\n+ * \\return True if no buffer is pending for completion, false otherwise\n+ */\n+\n /**\n  * \\brief Prepare the resources for the completion handler\n  */\n@@ -127,7 +134,7 @@ int Request::prepare()\n  */\n void Request::complete(Status status)\n {\n-\tASSERT(pending_.empty());\n+\tASSERT(empty());\n \tstatus_ = status;\n }\n \n@@ -149,7 +156,7 @@ bool Request::completeBuffer(Buffer *buffer)\n \tint ret = pending_.erase(buffer);\n \tASSERT(ret == 1);\n \n-\treturn pending_.empty();\n+\treturn empty();\n }\n \n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "4/7"
    ]
}