Show a patch.

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

{
    "id": 11759,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11759/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11759/",
    "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": "<20210329061119.135513-3-hiroh@chromium.org>",
    "date": "2021-03-29T06:11:19",
    "name": "[libcamera-devel,v3,2/2] android: CameraDevice: Add stop()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "457aa0570527989dce13f4e3f465462c55838128",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11759/mbox/",
    "series": [
        {
            "id": 1858,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1858/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1858",
            "date": "2021-03-29T06:11:17",
            "name": "Fix Camera3RequestDescriptor leakage",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1858/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11759/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11759/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 A749AC32EF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Mar 2021 06:11:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 61C3C6877D;\n\tMon, 29 Mar 2021 08:11:41 +0200 (CEST)",
            "from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com\n\t[IPv6:2607:f8b0:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B4E54602D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Mar 2021 08:11:38 +0200 (CEST)",
            "by mail-pf1-x42d.google.com with SMTP id 11so9182297pfn.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 28 Mar 2021 23:11:38 -0700 (PDT)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:1db7:ae60:9288:b906])\n\tby smtp.gmail.com with ESMTPSA id\n\tf2sm16445975pfq.129.2021.03.28.23.11.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 28 Mar 2021 23:11:27 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"jWwSpxw9\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=S0BbWN1J8xV7FErOAojsZ+fHvtyZlbls2qp4CgRYcQ4=;\n\tb=jWwSpxw90Kjo08Ou2TUbPCIq0bd0COdC+9xh76Hgung+cnjRCY9hA/gKI8hoTKqoQa\n\tGaMPKy600FaENYsYe8PeXJ86Avpj+Y1/d+kyzxDBQ5F3vPp64dVa4JuRLYcWKp+j8s1i\n\t7tG3JAiQGgLoHiwqPg5hcbVSEP16cluJI/fkM=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=S0BbWN1J8xV7FErOAojsZ+fHvtyZlbls2qp4CgRYcQ4=;\n\tb=eS11pEWLNPxHpsS5xgSNALMB0heOjNPAdNLiHSgGOUqMUd7LaqGeFWpIAeDq9PEdqq\n\txQtLjxWkZYTDmZOFnLe5V6qaJREqRSMgV7bzm9FCn/X5z2KOHn/A+bAJZIfXID/ZUvzD\n\twrUXUqufN8dX2K1NilDairnoL+qrjLJ5Jyx9welWtRoPmTaYdwpffzPvTSYEjYrkvji6\n\tcnO4s3E15Zz7/gUs4eBnuKwxhUAeODFLX9bXjsoFbZ0Bn3CyAJFxv1XwUZ3TqyZ4IBu4\n\tC0Nqdlx5lkqYuKIqqDlrBSZruYeRjeYruSEz5Edf8UYgnJ7HFN3rZxvWd7UTAdU04d81\n\tTArg==",
        "X-Gm-Message-State": "AOAM530bgL6oM7Ihxzr6MsDPwZI+vBqCKq37IEBiykO/oA8w5EpcravY\n\tZQpKy33wcW/RS5V3fEzD6hfXFPBQsYisDA==",
        "X-Google-Smtp-Source": "ABdhPJwOpgZl0M8F6EAcKF4dayMie13R5+QQgBhxiROQhzXwr1mMQ44bbmAiYl3el/LDbE5M00fxng==",
        "X-Received": "by 2002:aa7:9431:0:b029:1f1:52fd:5444 with SMTP id\n\ty17-20020aa794310000b02901f152fd5444mr23377479pfo.47.1616998288304; \n\tSun, 28 Mar 2021 23:11:28 -0700 (PDT)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 29 Mar 2021 15:11:19 +0900",
        "Message-Id": "<20210329061119.135513-3-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.31.0.291.g576ba9dcdaf-goog",
        "In-Reply-To": "<20210329061119.135513-1-hiroh@chromium.org>",
        "References": "<20210329061119.135513-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 2/2] android: CameraDevice: Add stop()",
        "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": "This adds CameraDevice::stop(), which cleans up the member\nvariables of CameraDevice. It is called in CameraDevice::close()\nand CameraDevice::configureStreams().\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp | 17 +++++++++--------\n src/android/camera_device.h   |  2 ++\n 2 files changed, 11 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 02d3bfb2..d5447d8e 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -659,12 +659,17 @@ int CameraDevice::open(const hw_module_t *hardwareModule)\n \n void CameraDevice::close()\n {\n-\tstreams_.clear();\n+\tstop();\n+\n+\tcamera_->release();\n+}\n \n+void CameraDevice::stop()\n+{\n \tworker_.stop();\n \tcamera_->stop();\n-\tcamera_->release();\n \n+\tdescriptors_.clear();\n \trunning_ = false;\n }\n \n@@ -1547,12 +1552,8 @@ PixelFormat CameraDevice::toPixelFormat(int format) const\n  */\n int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n {\n-\t/* Before any configuration attempt, stop the camera if it's running. */\n-\tif (running_) {\n-\t\tworker_.stop();\n-\t\tcamera_->stop();\n-\t\trunning_ = false;\n-\t}\n+\t/* Before any configuration attempt, stop the camera. */\n+\tstop();\n \n \t/*\n \t * Generate an empty configuration, and construct a StreamConfiguration\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 5a2d22d6..cc12fe20 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -87,6 +87,8 @@ private:\n \t\tint androidFormat;\n \t};\n \n+\tvoid stop();\n+\n \tint initializeStreamConfigurations();\n \tstd::vector<libcamera::Size>\n \tgetYUVResolutions(libcamera::CameraConfiguration *cameraConfig,\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "2/2"
    ]
}