{"id":10154,"url":"https://patchwork.libcamera.org/api/patches/10154/?format=json","web_url":"https://patchwork.libcamera.org/patch/10154/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20201021013955.301790-4-hiroh@chromium.org>","date":"2020-10-21T01:39:55","name":"[libcamera-devel,v3,4/4] android: camera_stream: Make some member variables constant","commit_ref":"bb27fbf253ecbcba9046bc69b94a2c0152137aad","pull_url":null,"state":"accepted","archived":false,"hash":"e3e6443b50cc5a96a2a6cb4c4caa1480a99ad8e7","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10154/mbox/","series":[{"id":1395,"url":"https://patchwork.libcamera.org/api/series/1395/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1395","date":"2020-10-21T01:39:52","name":"[libcamera-devel,v3,1/4] android: Modify PostProcessor interface","version":3,"mbox":"https://patchwork.libcamera.org/series/1395/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10154/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10154/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 9AD7EBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Oct 2020 01:40:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 66E8661DCF;\n\tWed, 21 Oct 2020 03:40:11 +0200 (CEST)","from mail-pf1-x431.google.com (mail-pf1-x431.google.com\n\t[IPv6:2607:f8b0:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6340461D98\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Oct 2020 03:40:10 +0200 (CEST)","by mail-pf1-x431.google.com with SMTP id 10so510422pfp.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Oct 2020 18:40:10 -0700 (PDT)","from hiroh.tok.corp.google.com\n\t([2401:fa00:8f:2:de4a:3eff:fe7d:f78f])\n\tby smtp.gmail.com with ESMTPSA id\n\tw2sm368066pgi.56.2020.10.20.18.40.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 20 Oct 2020 18:40:08 -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=\"Zbdb08lG\"; 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=VsrjIa5fn9BIm7cmFlwzxqjDvLZ5QlFd0dv9kJ5Bx3c=;\n\tb=Zbdb08lGBT7rswY33ejR7uk+jonCvRLtDo7zA6WRyWqKM/04mjMyGkMzCUw1nPdEGr\n\t7Na9ys79hqn77lRyOSYokygKekxn5yY7svel8lr6bnkcwxqM6uNMe8jP9xptBDhjJmv3\n\tH+Qs1AaiMeOJXZe7sgWiDnbHdFQ8MAPVw27+4=","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=VsrjIa5fn9BIm7cmFlwzxqjDvLZ5QlFd0dv9kJ5Bx3c=;\n\tb=e/b2n+6AL7e/uY+CEZoO2r9WSYOqBoAP90k9GOg3i4iwowJOMs0uG5gbNkQtUag4Z6\n\tW88ICY2Qe5Fbq0mF/+TfjamDOaogW2L6+XLKdzPoL3/ofxj3ML1PurVOgIWb+hkI1GAc\n\tib5BEXxvdjxtImNp7EAh3wxl8EmG1wpN1EGaDV53VOVeZHZRn/5HRJhE2+Y0/uFfk9BM\n\tT2zNmPWCwXctZSHMiK2xefBgSeiLQn8JAgtMec8WyllxzvVO/atrghcTFeOdkSpw7LP4\n\tS/Pf7l08c7UPRYtLHra3RKLJE6xjCNv6ksZ0h3+iEGt9d2I8POVlYeA2RKa42Ww07bWZ\n\tCzkw==","X-Gm-Message-State":"AOAM530x1i3wvUMyr++VCW3ljg4IlBlTcdmi8UpeRniy5pPvzPdHp0lT\n\tJ3qgs7D3ULG6y8I+ymFh6wuSUtu6aJxTVg==","X-Google-Smtp-Source":"ABdhPJyLyumRCeelgrgHalCXiOe/9FiQKQkRMnxI8+r+Aq8q1xcEHwiKsqyj5MjXuAHa1N/Mfmdx0w==","X-Received":"by 2002:a63:d90d:: with SMTP id r13mr904026pgg.99.1603244408832; \n\tTue, 20 Oct 2020 18:40:08 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 21 Oct 2020 10:39:55 +0900","Message-Id":"<20201021013955.301790-4-hiroh@chromium.org>","X-Mailer":"git-send-email 2.29.0.rc1.297.gfa9743e501-goog","In-Reply-To":"<20201021013955.301790-1-hiroh@chromium.org>","References":"<20201021013955.301790-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 4/4] android: camera_stream: Make some\n\tmember variables constant","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":"CameraStream initializes several member variables in the\ninitializer list. Some of them are unchanged after. This makes\nthem constant. Especially, doing to |cameraDevice_| represents\nCameraStream doesn't have the ownership of it.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Umang Jain <email@uajain.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_stream.cpp |  7 +++----\n src/android/camera_stream.h   | 10 +++++-----\n 2 files changed, 8 insertions(+), 9 deletions(-)","diff":"diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\nindex 3e5d6be..dba351a 100644\n--- a/src/android/camera_stream.cpp\n+++ b/src/android/camera_stream.cpp\n@@ -38,13 +38,12 @@ LOG_DECLARE_CATEGORY(HAL)\n  * and buffer allocation.\n  */\n \n-CameraStream::CameraStream(CameraDevice *cameraDevice, Type type,\n+CameraStream::CameraStream(CameraDevice *const cameraDevice, Type type,\n \t\t\t   camera3_stream_t *camera3Stream, unsigned int index)\n-\t: cameraDevice_(cameraDevice), type_(type),\n+\t: cameraDevice_(cameraDevice),\n+\t  config_(cameraDevice->cameraConfiguration()), type_(type),\n \t  camera3Stream_(camera3Stream), index_(index)\n {\n-\tconfig_ = cameraDevice_->cameraConfiguration();\n-\n \tif (type_ == Type::Internal || type_ == Type::Mapped) {\n \t\t/*\n \t\t * \\todo There might be multiple post-processors. The logic\ndiff --git a/src/android/camera_stream.h b/src/android/camera_stream.h\nindex c367a5f..cc9d547 100644\n--- a/src/android/camera_stream.h\n+++ b/src/android/camera_stream.h\n@@ -109,7 +109,7 @@ public:\n \t\tInternal,\n \t\tMapped,\n \t};\n-\tCameraStream(CameraDevice *cameraDevice, Type type,\n+\tCameraStream(CameraDevice *const cameraDevice, Type type,\n \t\t     camera3_stream_t *camera3Stream, unsigned int index);\n \n \tType type() const { return type_; }\n@@ -124,11 +124,11 @@ public:\n \tvoid putBuffer(libcamera::FrameBuffer *buffer);\n \n private:\n-\tCameraDevice *cameraDevice_;\n-\tlibcamera::CameraConfiguration *config_;\n-\tType type_;\n+\tCameraDevice *const cameraDevice_;\n+\tconst libcamera::CameraConfiguration *config_;\n+\tconst Type type_;\n \tcamera3_stream_t *camera3Stream_;\n-\tunsigned int index_;\n+\tconst unsigned int index_;\n \n \tstd::unique_ptr<libcamera::FrameBufferAllocator> allocator_;\n \tstd::vector<libcamera::FrameBuffer *> buffers_;\n","prefixes":["libcamera-devel","v3","4/4"]}