Show a patch.

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

{
    "id": 8649,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/8649/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8649/",
    "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": "<20200706134919.19224-1-laurent.pinchart@ideasonboard.com>",
    "date": "2020-07-06T13:49:19",
    "name": "[libcamera-devel,v2] libcamera: ipa_proxy: Allow stop() on a stopped IPA",
    "commit_ref": "49771c6dccb28228839b5e88ada36bd6646bf933",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "805ab8142fd2d5ad2297a3a1eb7ccc4df695526d",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8649/mbox/",
    "series": [
        {
            "id": 1086,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1086/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1086",
            "date": "2020-07-06T13:49:19",
            "name": "[libcamera-devel,v2] libcamera: ipa_proxy: Allow stop() on a stopped IPA",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1086/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8649/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8649/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 3CEF0BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jul 2020 13:49:35 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C53BC60E01;\n\tMon,  6 Jul 2020 15:49:34 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E40E603AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 15:49:33 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EF8E797E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jul 2020 15:49:32 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"wmlFr5zC\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594043373;\n\tbh=xz0LxTB2KnyOvlJvX+vnocWm0MSl8SqJA+orL6dkxFs=;\n\th=From:To:Subject:Date:From;\n\tb=wmlFr5zCsOfFjP2z3IOz22qdgU1OWaGtg0FrAnUIN0QfWs1PnWe6hgkDQOJsDIjPA\n\ttcjjjpn7ONKvn22zbf/jBBtoq3MGdoMNJY/j4knqnC48h/nAA3Muxy0iaSmmnT8zDV\n\t2Zgz+y6UnJKLs3aO2pMK2CfAYs8cpegvycudTR70=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  6 Jul 2020 16:49:19 +0300",
        "Message-Id": "<20200706134919.19224-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2] libcamera: ipa_proxy: Allow stop() on\n\ta stopped IPA",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "To make error handling easier in callers, allow the stop() function to\nbe called when the proxy is already stopped, or not started yet.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\nChanges since v1:\n\n- Rewrite documentation\n---\n include/libcamera/internal/ipa_proxy.h   |  2 ++\n src/libcamera/ipa_proxy.cpp              | 10 ++++++++++\n src/libcamera/proxy/ipa_proxy_thread.cpp |  3 +++\n 3 files changed, 15 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h\nindex aec8f04ffc15..b429ce5a68a3 100644\n--- a/include/libcamera/internal/ipa_proxy.h\n+++ b/include/libcamera/internal/ipa_proxy.h\n@@ -27,6 +27,8 @@ public:\n \n \tstd::string configurationFile(const std::string &file) const;\n \n+\tvoid stop() override = 0;\n+\n protected:\n \tstd::string resolvePath(const std::string &file) const;\n \ndiff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp\nindex 23be24ad9bf1..ff4d7fd18cda 100644\n--- a/src/libcamera/ipa_proxy.cpp\n+++ b/src/libcamera/ipa_proxy.cpp\n@@ -145,6 +145,16 @@ std::string IPAProxy::configurationFile(const std::string &name) const\n \treturn std::string();\n }\n \n+/**\n+ * \\fn IPAProxy::stop()\n+ * \\brief Stop the IPA proxy\n+ *\n+ * This function stops the IPA and releases all the resources acquired by the\n+ * proxy in start(). Calling stop() when the IPA proxy hasn't been started or\n+ * has already been stopped is valid, the proxy shall treat this as a no-op and\n+ * shall not forward the call to the IPA.\n+ */\n+\n /**\n  * \\brief Find a valid full path for a proxy worker for a given executable name\n  * \\param[in] file File name of proxy worker executable\ndiff --git a/src/libcamera/proxy/ipa_proxy_thread.cpp b/src/libcamera/proxy/ipa_proxy_thread.cpp\nindex aa403e22f297..eead2883708d 100644\n--- a/src/libcamera/proxy/ipa_proxy_thread.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_thread.cpp\n@@ -121,6 +121,9 @@ int IPAProxyThread::start()\n \n void IPAProxyThread::stop()\n {\n+\tif (!running_)\n+\t\treturn;\n+\n \trunning_ = false;\n \n \tproxy_.invokeMethod(&ThreadProxy::stop, ConnectionTypeBlocking);\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}