Patch Detail
Show a patch.
GET /api/1.1/patches/11679/?format=api
{ "id": 11679, "url": "https://patchwork.libcamera.org/api/1.1/patches/11679/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11679/", "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": "<20210324070757.3530377-5-hiroh@chromium.org>", "date": "2021-03-24T07:07:53", "name": "[libcamera-devel,v2,4/8] android: CameraDevice: Take shared_ptr in constructor", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c9cabdc4cec65650078effb7301de3562eb1126f", "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/11679/mbox/", "series": [ { "id": 1825, "url": "https://patchwork.libcamera.org/api/1.1/series/1825/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1825", "date": "2021-03-24T07:07:51", "name": "Improve pointer types in android HAL adaptation layer", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1825/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11679/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11679/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 B1183C32E7\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Mar 2021 07:08:19 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6B7AC68D6A;\n\tWed, 24 Mar 2021 08:08:19 +0100 (CET)", "from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com\n\t[IPv6:2607:f8b0:4864:20::52d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8039568D62\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Mar 2021 08:08:14 +0100 (CET)", "by mail-pg1-x52d.google.com with SMTP id l1so14000736pgb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Mar 2021 00:08:14 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:7c07:24cd:c637:7fab])\n\tby smtp.gmail.com with ESMTPSA id\n\te63sm1246860pfe.208.2021.03.24.00.08.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 24 Mar 2021 00:08:10 -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=\"TqFwzCt3\"; 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=HzUlrxUAqE+9T4gZTTau+eWKMHgxbMHPiiSANl2yyjY=;\n\tb=TqFwzCt3G5sitV7MY0b/MaOYbxteMlxeXD5Gx6TisUwUb9TDDdOmQoIt+rmq5c4vR3\n\thEvRbq/L2MbPAsYF4l+RVLh3vO0LlmEbrVy5j1VmswMJFQ5Ljx8goSrjRNxcEmeCAnw8\n\tmxgZHoCiY0uo0zwFmyTHfiFM1S1NcOBbWQfgs=", "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=HzUlrxUAqE+9T4gZTTau+eWKMHgxbMHPiiSANl2yyjY=;\n\tb=jCgz0NyoQtvyDsGhhhkFV2/OHyqHJSgotTi38IFWKSx2xn7qloCta7w3zmKGTTQ4kM\n\t45SFjUb1AFpY0Y/cmFxxEKuVka7e4/hfqR/F7aomTkbMw/nUqic1uDV5fhTyZa/1Fw4Q\n\tLZsZK7MjbWtjn/NjGuTIdiyjSYpVhJYxgjvLfIRgjQHVYLb0kTmTGNuoLARKH3Oa8ZMC\n\tbQEvwfLcUwehFlpFBK70EPS8ZgZnMgs/KtaIJI+YoVm60ZriwRAUjA0W+fuzbauGfVKZ\n\t1+qbwJh44El6UpK4YRPDiyULVFC2/TbVgqoiZOboq82uiBWeyrHc4lTzE5oLRT7Lti0I\n\toLOg==", "X-Gm-Message-State": "AOAM531nPiCLfzjYqka82PJ1bF0K9XlFk67ngeQMbpFZS7UI2+20vVKm\n\t1EtHSN1LyQKobFeUgCADTFyp+L7zwNfQuQ==", "X-Google-Smtp-Source": "ABdhPJzEXGHg+d9rqA+Aj3koWonJmIDOZ9Byn4ObhcGZcAFIoEzNi5A1N3Qx72TW2GWMShRB7EwcVQ==", "X-Received": "by 2002:a63:7e52:: with SMTP id\n\to18mr1854555pgn.416.1616569690676; \n\tWed, 24 Mar 2021 00:08:10 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 24 Mar 2021 16:07:53 +0900", "Message-Id": "<20210324070757.3530377-5-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.0.291.g576ba9dcdaf-goog", "In-Reply-To": "<20210324070757.3530377-1-hiroh@chromium.org>", "References": "<20210324070757.3530377-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 4/8] android: CameraDevice: Take\n\tshared_ptr in constructor", "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": "CameraDevice takes the ownership of Camera. Therefore,\nshared_ptr would rather be used than const shared_ptr&.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_device.cpp | 12 +++++++-----\n src/android/camera_device.h | 4 ++--\n 2 files changed, 9 insertions(+), 7 deletions(-)\n\n--\n2.31.0.291.g576ba9dcdaf-goog", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex d0955de7..c0630e53 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -312,9 +312,10 @@ CameraDevice::Camera3RequestDescriptor::~Camera3RequestDescriptor()\n * back to the framework using the designated callbacks.\n */\n\n-CameraDevice::CameraDevice(unsigned int id, const std::shared_ptr<Camera> &camera)\n-\t: id_(id), running_(false), camera_(camera), staticMetadata_(nullptr),\n-\t facing_(CAMERA_FACING_FRONT), orientation_(0)\n+CameraDevice::CameraDevice(unsigned int id, std::shared_ptr<Camera> camera)\n+\t: id_(id), running_(false), camera_(std::move(camera)),\n+\t staticMetadata_(nullptr), facing_(CAMERA_FACING_FRONT),\n+\t orientation_(0)\n {\n \tcamera_->requestCompleted.connect(this, &CameraDevice::requestComplete);\n\n@@ -351,9 +352,10 @@ CameraDevice::~CameraDevice()\n }\n\n std::unique_ptr<CameraDevice> CameraDevice::create(unsigned int id,\n-\t\t\t\t\t\t const std::shared_ptr<Camera> &cam)\n+\t\t\t\t\t\t std::shared_ptr<Camera> cam)\n {\n-\treturn std::unique_ptr<CameraDevice>(new CameraDevice(id, cam));\n+\treturn std::unique_ptr<CameraDevice>(\n+\t\tnew CameraDevice(id, std::move(cam)));\n }\n\n /*\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 8be7f305..555b33e7 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -33,7 +33,7 @@ class CameraDevice : protected libcamera::Loggable\n {\n public:\n \tstatic std::unique_ptr<CameraDevice> create(unsigned int id,\n-\t\t\t\t\t\t const std::shared_ptr<libcamera::Camera> &cam);\n+\t\t\t\t\t\t std::shared_ptr<libcamera::Camera> cam);\n \t~CameraDevice();\n\n \tint initialize();\n@@ -66,7 +66,7 @@ protected:\n \tstd::string logPrefix() const override;\n\n private:\n-\tCameraDevice(unsigned int id, const std::shared_ptr<libcamera::Camera> &camera);\n+\tCameraDevice(unsigned int id, std::shared_ptr<libcamera::Camera> camera);\n\n \tstruct Camera3RequestDescriptor {\n \t\tCamera3RequestDescriptor(libcamera::Camera *camera,\n", "prefixes": [ "libcamera-devel", "v2", "4/8" ] }