{"id":11706,"url":"https://patchwork.libcamera.org/api/1.1/patches/11706/?format=json","web_url":"https://patchwork.libcamera.org/patch/11706/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210325111357.3862847-1-hiroh@chromium.org>","date":"2021-03-25T11:13:56","name":"[libcamera-devel,1/2] android: CameraDevice: Mark getResultMetadata() const function","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"89cb44f47b6a1f5ed8cb2bafb982dc250e20e20a","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11706/mbox/","series":[{"id":1831,"url":"https://patchwork.libcamera.org/api/1.1/series/1831/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1831","date":"2021-03-25T11:13:56","name":"[libcamera-devel,1/2] android: CameraDevice: Mark getResultMetadata() const function","version":1,"mbox":"https://patchwork.libcamera.org/series/1831/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11706/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11706/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 A6BBCBDC66\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Mar 2021 11:14:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E698168D65;\n\tThu, 25 Mar 2021 12:14:05 +0100 (CET)","from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com\n\t[IPv6:2607:f8b0:4864:20::52b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDA42602D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Mar 2021 12:14:04 +0100 (CET)","by mail-pg1-x52b.google.com with SMTP id u19so1427695pgh.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Mar 2021 04:14:04 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:8de:2f19:4b87:ef01])\n\tby smtp.gmail.com with ESMTPSA id\n\t202sm5503803pfu.46.2021.03.25.04.14.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 25 Mar 2021 04:14:02 -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=\"XRSBdCAv\"; 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=swpYWXv8pZADKxhv3P2NWUwDpKqWYN1hW5XFmXO4vPk=;\n\tb=XRSBdCAvbdF007UwP3zl9/oD/xgjheZjw9k7zYDeJPrWFwIU5Z6jnvYVZo29mIDrTf\n\t/mo1rA8Eh5yvBeupEkwuM5iFoEiZLocfpxJt/dSH2TgsWVnKBpk7BQ3vzx3W1GqnTzLt\n\tAXPkQDHilqa7Tdata0xZsLsT7eTWidMI9rW0k=","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=swpYWXv8pZADKxhv3P2NWUwDpKqWYN1hW5XFmXO4vPk=;\n\tb=oYCt0kpygqFslnNGpb7xoSriek9MHu51jLzw/rt3bRe1k/9vRKFZtTzsB0a1R/Gh32\n\tAekHmnxKtzrjyCTs6I3rk53ArnQ74ri4EMMRnOMGO2byVOBPjZTgPLlR/EXl9Tn1yI1S\n\tokeoxdv0oq7KFY7CuiUbFSNIDRKxWh8bz9YkElZm8yAhLuO5e2creFpSSN+8+ki2HcQC\n\tPcUNjHUzfT1iZcVMIuXN2hmOHOgWMsDpJ6Ayt/l2jnynSRefnljaU+1BixqSLo4cE/3Y\n\tNGHoVwKp1moMwsxN9Wbbo0IENrl1TUEVvdKovfCVYlQO+9/Dj1PaAdXkd8aSk9804coS\n\tUPSA==","X-Gm-Message-State":"AOAM532YX9pjVeiozcNytrPhULhrgU3LZsLXTuhoqKvSCeX0X75H2j39\n\tWRfn9Wb29CQlv4r2GNEUnVolgLpVnjcl1A==","X-Google-Smtp-Source":"ABdhPJxfkU8KZ7YC4utiRteDq44Et/yWHyCms2ePgAGu3jfRFLBVlTp1JpaBiJIG6VU/T3qu2Yx0eA==","X-Received":"by 2002:a17:902:7682:b029:e6:2bc5:f005 with SMTP id\n\tm2-20020a1709027682b02900e62bc5f005mr9131613pll.32.1616670843146; \n\tThu, 25 Mar 2021 04:14:03 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 25 Mar 2021 20:13:56 +0900","Message-Id":"<20210325111357.3862847-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.0.291.g576ba9dcdaf-goog","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 1/2] android: CameraDevice: Mark\n\tgetResultMetadata() const function","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::getResultMetadata() doesn't change either\n|descriptor| and member variables. It should be marked as a\nconst function and |descriptor| should be passed with const\nlvalue reference.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp | 10 +++++-----\n src/android/camera_device.h   |  3 ++-\n 2 files changed, 7 insertions(+), 6 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 5fbf6f82..ae693664 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1924,7 +1924,7 @@ void CameraDevice::requestComplete(Request *request)\n \t * pipeline handlers) timestamp in the Request itself.\n \t */\n \tuint64_t timestamp = buffers.begin()->second->metadata().timestamp;\n-\tresultMetadata = getResultMetadata(descriptor, timestamp);\n+\tresultMetadata = getResultMetadata(*descriptor, timestamp);\n\n \t/* Handle any JPEG compression. */\n \tfor (camera3_stream_buffer_t &buffer : descriptor->buffers_) {\n@@ -2030,11 +2030,11 @@ void CameraDevice::notifyError(uint32_t frameNumber, camera3_stream_t *stream)\n  * Produce a set of fixed result metadata.\n  */\n std::unique_ptr<CameraMetadata>\n-CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,\n-\t\t\t\tint64_t timestamp)\n+CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor,\n+\t\t\t\tint64_t timestamp) const\n {\n-\tconst ControlList &metadata = descriptor->request_->metadata();\n-\tconst CameraMetadata &settings = descriptor->settings_;\n+\tconst ControlList &metadata = descriptor.request_->metadata();\n+\tconst CameraMetadata &settings = descriptor.settings_;\n \tcamera_metadata_ro_entry_t entry;\n \tbool found;\n\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 09c395ff..11bdfec8 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -102,7 +102,8 @@ private:\n \tlibcamera::PixelFormat toPixelFormat(int format) const;\n \tint processControls(Camera3RequestDescriptor *descriptor);\n \tstd::unique_ptr<CameraMetadata> getResultMetadata(\n-\t\tCamera3RequestDescriptor *descriptor, int64_t timestamp);\n+\t\tconst Camera3RequestDescriptor &descriptor,\n+\t\tint64_t timestamp) const;\n\n \tunsigned int id_;\n \tcamera3_device_t camera3Device_;\n","prefixes":["libcamera-devel","1/2"]}