Show a patch.

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

{
    "id": 2827,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2827/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2827/",
    "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": "<20200214001810.19302-3-kieran.bingham@ideasonboard.com>",
    "date": "2020-02-14T00:18:05",
    "name": "[libcamera-devel,v2,2/7] qcam: Move requestCompleted signal mapping",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "943864f58fdd1c41521d77e9a120233e2980a0c4",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/2827/mbox/",
    "series": [
        {
            "id": 673,
            "url": "https://patchwork.libcamera.org/api/1.1/series/673/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=673",
            "date": "2020-02-14T00:18:03",
            "name": "qcam: Provide an initial toolbar",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/673/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2827/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2827/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kieran.bingham@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 78BE861A27\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Feb 2020 01:18:14 +0100 (CET)",
            "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0EFEDACB;\n\tFri, 14 Feb 2020 01:18:14 +0100 (CET)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1581639494;\n\tbh=ShGOxG420dnZpKSx4t3QMA9CliIH3Z8xwUWWjw5g+sM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=lUE8d8Pnb1g56012UZAKKseqJZNNXd2YwEqem5vUdQKHZ7O2sQrxvX4l02tsYOtId\n\tQMrpgRX4yOaaAS0CqfKFS94WG69oLw849ohWb1K39CgK7DPNHhVxmzRXASvazsPcrF\n\tzWH6uhYTs/WdNKI5v+WcXNC2pUHQ6MqGnVu+9Flk=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Fri, 14 Feb 2020 00:18:05 +0000",
        "Message-Id": "<20200214001810.19302-3-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200214001810.19302-1-kieran.bingham@ideasonboard.com>",
        "References": "<20200214001810.19302-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/7] qcam: Move requestCompleted signal\n\tmapping",
        "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>",
        "X-List-Received-Date": "Fri, 14 Feb 2020 00:18:14 -0000"
    },
    "content": "The MainWindow connects a handler to the Camera requestCompleted signal\nwhen the camera is opened, but never disconnects it.\n\nMove the connection to the startCapture() function, and ensure that it\nis disconnected again when the stream is stopped.\n\nThis ensures that we can successfully tear down the stream, and restart\nwith a new camera.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/qcam/main_window.cpp | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex db14245d7f51..38d7063363f0 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -113,8 +113,6 @@ int MainWindow::openCamera(CameraManager *cm)\n \n \tstd::cout << \"Using camera \" << camera_->name() << std::endl;\n \n-\tcamera_->requestCompleted.connect(this, &MainWindow::requestComplete);\n-\n \treturn 0;\n }\n \n@@ -212,17 +210,23 @@ int MainWindow::startCapture()\n \t\tgoto error;\n \t}\n \n+\tcamera_->requestCompleted.connect(this, &MainWindow::requestComplete);\n+\n \tfor (Request *request : requests) {\n \t\tret = camera_->queueRequest(request);\n \t\tif (ret < 0) {\n \t\t\tstd::cerr << \"Can't queue request\" << std::endl;\n-\t\t\tgoto error;\n+\t\t\tgoto error_disconnect;\n \t\t}\n \t}\n \n \tisCapturing_ = true;\n \treturn 0;\n \n+error_disconnect:\n+\tcamera_->requestCompleted.disconnect(this, &MainWindow::requestComplete);\n+\tcamera_->stop();\n+\n error:\n \tfor (Request *request : requests)\n \t\tdelete request;\n@@ -249,6 +253,8 @@ void MainWindow::stopCapture()\n \tif (ret)\n \t\tstd::cout << \"Failed to stop capture\" << std::endl;\n \n+\tcamera_->requestCompleted.disconnect(this, &MainWindow::requestComplete);\n+\n \tfor (auto &iter : mappedBuffers_) {\n \t\tvoid *memory = iter.second.first;\n \t\tunsigned int length = iter.second.second;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/7"
    ]
}