Show a patch.

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

{
    "id": 1616,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1616/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1616/",
    "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": "<20190704145942.17879-4-kieran.bingham@ideasonboard.com>",
    "date": "2019-07-04T14:59:39",
    "name": "[libcamera-devel,v4,3/6] qcam: Move static timestamp to MainWindow",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0fac94abc04ab0f21e64f9bfea67156616fc597c",
    "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/1616/mbox/",
    "series": [
        {
            "id": 405,
            "url": "https://patchwork.libcamera.org/api/1.1/series/405/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=405",
            "date": "2019-07-04T14:59:36",
            "name": "Automatic Version Generation ++",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/405/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1616/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1616/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kieran.bingham@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3731561570\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jul 2019 16:59:47 +0200 (CEST)",
            "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 B41A2F7B;\n\tThu,  4 Jul 2019 16:59:46 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1562252386;\n\tbh=hpAdJ1Frx97sr3AhhePfmNLQau/b6lCTcUYGLPg0jKE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=vKV1akXsYnXDqv49yDyLmy2DLYTshPLONztt7FWYnMfI5ilAH3D3hVepcHrO9KaXz\n\tcEY92MEo9S9mjngK1y1TMdTuOHu+2x8FDG0EgGCZnouy3EGtksS8YCAFQSyPTqbowe\n\tBIKXZpYv4i0Eq0GeCGGFfSmnlD8IHXwVGiFh3x7A=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Thu,  4 Jul 2019 15:59:39 +0100",
        "Message-Id": "<20190704145942.17879-4-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190704145942.17879-1-kieran.bingham@ideasonboard.com>",
        "References": "<20190704145942.17879-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 3/6] qcam: Move static timestamp to\n\tMainWindow",
        "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": "Thu, 04 Jul 2019 14:59:47 -0000"
    },
    "content": "The 'last' buffer timestamp is stored as a static. Rename the variable\nto a more descritive 'lastBufferTime' and move it to the class instance.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/qcam/main_window.cpp | 10 +++++-----\n src/qcam/main_window.h   |  2 ++\n 2 files changed, 7 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 16b123132dd9..0f737d852960 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -144,6 +144,8 @@ int MainWindow::startCapture()\n \t\trequests.push_back(request);\n \t}\n \n+\tlastBufferTime_ = 0;\n+\n \tret = camera_->start();\n \tif (ret) {\n \t\tstd::cout << \"Failed to start capture\" << std::endl;\n@@ -187,16 +189,14 @@ void MainWindow::stopCapture()\n void MainWindow::requestComplete(Request *request,\n \t\t\t\t const std::map<Stream *, Buffer *> &buffers)\n {\n-\tstatic uint64_t last = 0;\n-\n \tif (request->status() == Request::RequestCancelled)\n \t\treturn;\n \n \tBuffer *buffer = buffers.begin()->second;\n \n-\tdouble fps = buffer->timestamp() - last;\n-\tfps = last && fps ? 1000000000.0 / fps : 0.0;\n-\tlast = buffer->timestamp();\n+\tdouble fps = buffer->timestamp() - lastBufferTime_;\n+\tfps = lastBufferTime_ && fps ? 1000000000.0 / fps : 0.0;\n+\tlastBufferTime_ = buffer->timestamp();\n \n \tstd::cout << \"seq: \" << std::setw(6) << std::setfill('0') << buffer->sequence()\n \t\t  << \" buf: \" << buffer->index()\ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex fe565cbcb460..345bdaaed354 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -48,6 +48,8 @@ private:\n \tbool isCapturing_;\n \tstd::unique_ptr<CameraConfiguration> config_;\n \n+\tuint64_t lastBufferTime_;\n+\n \tViewFinder *viewfinder_;\n };\n \n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "3/6"
    ]
}