{"id":10933,"url":"https://patchwork.libcamera.org/api/patches/10933/?format=json","web_url":"https://patchwork.libcamera.org/patch/10933/","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":"<20210121165305.367801-6-jacopo@jmondi.org>","date":"2021-01-21T16:53:03","name":"[libcamera-devel,5/7] android: camera_device: Clone settings in request descriptor","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"6ff7c4b5d35ca7ce981c9612317591ccd078f86e","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10933/mbox/","series":[{"id":1593,"url":"https://patchwork.libcamera.org/api/series/1593/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1593","date":"2021-01-21T16:52:58","name":"android: camera device and metadata improvements","version":1,"mbox":"https://patchwork.libcamera.org/series/1593/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10933/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10933/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 C2EFCC0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jan 2021 16:53:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 831AF6821E;\n\tThu, 21 Jan 2021 17:53:03 +0100 (CET)","from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9FFBF68202\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jan 2021 17:52:58 +0100 (CET)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 317B21C0012;\n\tThu, 21 Jan 2021 16:52:58 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org,\n\tPaul Elder <paul.elder@ideasonboard.com>","Date":"Thu, 21 Jan 2021 17:53:03 +0100","Message-Id":"<20210121165305.367801-6-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.29.2","In-Reply-To":"<20210121165305.367801-1-jacopo@jmondi.org>","References":"<20210121165305.367801-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 5/7] android: camera_device: Clone\n\tsettings in request descriptor","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":"When a Camera3RequestDescriptor instance is created to wrap a\ncamera3_capture_request_t the settings associated with the request\nare cloned for later re-use.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 4 +++-\n src/android/camera_device.h   | 4 ++--\n 2 files changed, 5 insertions(+), 3 deletions(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 578fb2271a9e..9733c84612bd 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -22,7 +22,6 @@\n #include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/utils.h\"\n \n-#include \"camera_metadata.h\"\n #include \"system/graphics.h\"\n \n using namespace libcamera;\n@@ -311,6 +310,9 @@ CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor(\n \t */\n \tframeBuffers_.reserve(numBuffers_);\n \n+\t/* Clone the controls associated with the camera3 request. */\n+\tsettings_ = CameraMetadata(camera3Request->settings);\n+\n \t/*\n \t * Create the libcamera::Request unique_ptr<> to tie its lifetime\n \t * to the descriptor's one. Set the descriptor's address as the\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex ab3c848edd0a..bad3be8e8066 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -24,12 +24,11 @@\n #include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/message.h\"\n \n+#include \"camera_metadata.h\"\n #include \"camera_stream.h\"\n #include \"camera_worker.h\"\n #include \"jpeg/encoder.h\"\n \n-class CameraMetadata;\n-\n class MappedCamera3Buffer : public libcamera::MappedBuffer\n {\n public:\n@@ -82,6 +81,7 @@ private:\n \t\tuint32_t numBuffers_;\n \t\tcamera3_stream_buffer_t *buffers_;\n \t\tstd::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;\n+\t\tCameraMetadata settings_;\n \t\tstd::unique_ptr<CaptureRequest> request_;\n \t};\n \n","prefixes":["libcamera-devel","5/7"]}