Patch Detail
Show a patch.
GET /api/patches/11785/?format=api
{ "id": 11785, "url": "https://patchwork.libcamera.org/api/patches/11785/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11785/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20210330054642.387562-1-hiroh@chromium.org>", "date": "2021-03-30T05:46:41", "name": "[libcamera-devel,v4,1/2] android: CameraDevice: Add stop()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "fd27d9b704c50335a52ef82ee3fb7804aab234f8", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11785/mbox/", "series": [ { "id": 1867, "url": "https://patchwork.libcamera.org/api/series/1867/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1867", "date": "2021-03-30T05:46:41", "name": "[libcamera-devel,v4,1/2] android: CameraDevice: Add stop()", "version": 4, "mbox": "https://patchwork.libcamera.org/series/1867/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11785/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11785/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 1B7E6C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Mar 2021 05:46:52 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7657768787;\n\tTue, 30 Mar 2021 07:46:51 +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 B3D0A602D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Mar 2021 07:46:49 +0200 (CEST)", "by mail-pf1-x42d.google.com with SMTP id x26so11443283pfn.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Mar 2021 22:46:49 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:c112:2822:484f:486])\n\tby smtp.gmail.com with ESMTPSA id\n\ty22sm18679396pfn.32.2021.03.29.22.46.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Mar 2021 22:46:47 -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=\"QYxXcr1Z\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=WDMIGvMK3UhEG/R2ElSVU98haTf20PV55Gz9xXNyv/M=;\n\tb=QYxXcr1Z0aIaixY6yo8J2P0x7YPuiD2w1B15jmagUkyvrDkUZ7RijPIUr1uXD3G3Kp\n\tI43TMHDOKzQq713iyVqsPx4+kPyIVIsRiiI+hpGdLfXOMYSeHXOclTEIzLYhEfnNIr1L\n\tPUlTiJEsxH3qNtC0ZiOEMRg+kVpzT4udE83ws=", "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:mime-version\n\t:content-transfer-encoding;\n\tbh=WDMIGvMK3UhEG/R2ElSVU98haTf20PV55Gz9xXNyv/M=;\n\tb=DotSO+kTJ1W+6yBXNZ4v8z6VFHmv+sdKiWNNDqZx7Zf84UY2z6Wc5M94ySsfNBl+1Q\n\tOcNMblMQhVD9Pd5y8J2Lj+qWEJASX8e6aN/1hHCFwJ/i6sw17ogzM4JHV9swlOgQ66ji\n\tXXUwdpln+RPdsKpishRIePk7yWKaZJsTSScqoVZoTR0Ebcu7CxJgqKeAuioCQ49H1Wd8\n\t02pBFZeDbEG+ZIZILIetmbWzg6gtc9LaTq/ylOqFCjXGd1nhsVUaxIpaf77Oq5+Alhvy\n\tH6mMNBKWhldghTbLE3wuVGqlmqTc21PWV+s5eSylTiZFH9mO6ufL2mgJibhV7gy6baev\n\tEZHg==", "X-Gm-Message-State": "AOAM533YjzJyLEZvcKdtchSQfI16DhxPTcEjw55WEe6/Vs4NwkmxGt1A\n\tAJo1K/o0MoALg0HkOE70NtDyAH4pel4rBw==", "X-Google-Smtp-Source": "ABdhPJyr27oDahMs6gF2fq9GpP4NUS0XH43fQr7BR5rIpk4GyDjC8ljoXsNHaTH0z4rEGbx2uTaglA==", "X-Received": "by 2002:a05:6a00:852:b029:211:d819:7f57 with SMTP id\n\tq18-20020a056a000852b0290211d8197f57mr27857443pfk.17.1617083207977; \n\tMon, 29 Mar 2021 22:46:47 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 30 Mar 2021 14:46:41 +0900", "Message-Id": "<20210330054642.387562-1-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.0.291.g576ba9dcdaf-goog", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v4 1/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 | 19 +++++++++++--------\n src/android/camera_device.h | 2 ++\n 2 files changed, 13 insertions(+), 8 deletions(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex ae693664..14299429 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -657,11 +657,18 @@ 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+\tif (!running_)\n+\t\treturn;\n \n \tworker_.stop();\n \tcamera_->stop();\n-\tcamera_->release();\n \n \trunning_ = false;\n }\n@@ -1545,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 11bdfec8..39cf95ad 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -85,6 +85,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", "v4", "1/2" ] }