[{"id":14673,"web_url":"https://patchwork.libcamera.org/comment/14673/","msgid":"<YAn0Owv3YLl/27B5@pendragon.ideasonboard.com>","date":"2021-01-21T21:38:03","subject":"Re: [libcamera-devel] [PATCH 5/7] android: camera_device: Clone\n\tsettings in request descriptor","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Thu, Jan 21, 2021 at 05:53:03PM +0100, Jacopo Mondi wrote:\n> When a Camera3RequestDescriptor instance is created to wrap a\n> camera3_capture_request_t the settings associated with the request\n> are cloned for later re-use.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/android/camera_device.cpp | 4 +++-\n>  src/android/camera_device.h   | 4 ++--\n>  2 files changed, 5 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 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\n> diff --git a/src/android/camera_device.h b/src/android/camera_device.h\n> index 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>","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 B4223C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jan 2021 21:38:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 786A868224;\n\tThu, 21 Jan 2021 22:38:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 913BF68220\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jan 2021 22:38:21 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1E0ED50E;\n\tThu, 21 Jan 2021 22:38:21 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kXxptsbk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1611265101;\n\tbh=78BepbU3wHcw7y39yvlL5/LhadSJA5geJsALXojuG8I=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=kXxptsbkGei87vGCersNeBLv2HtLXG8hElAzPR3Y2zxxynQzZMWiJrOztx4InPQgZ\n\tdRAesPPlX3zJFB00SELEL+iJr3mX3FK91zBF1i/L8GwR5P0SgU4Z5RgaoyZxkdLSiu\n\tqVircph6T48NF7DvWRxga2hpD7bchTBKxBSQg0Xs=","Date":"Thu, 21 Jan 2021 23:38:03 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YAn0Owv3YLl/27B5@pendragon.ideasonboard.com>","References":"<20210121165305.367801-1-jacopo@jmondi.org>\n\t<20210121165305.367801-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210121165305.367801-6-jacopo@jmondi.org>","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}},{"id":14680,"web_url":"https://patchwork.libcamera.org/comment/14680/","msgid":"<20210122041255.GG1943@pyrite.rasen.tech>","date":"2021-01-22T04:12:55","subject":"Re: [libcamera-devel] [PATCH 5/7] android: camera_device: Clone\n\tsettings in request descriptor","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Thu, Jan 21, 2021 at 05:53:03PM +0100, Jacopo Mondi wrote:\n> When a Camera3RequestDescriptor instance is created to wrap a\n> camera3_capture_request_t the settings associated with the request\n> are cloned for later re-use.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/android/camera_device.cpp | 4 +++-\n>  src/android/camera_device.h   | 4 ++--\n>  2 files changed, 5 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 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\n> diff --git a/src/android/camera_device.h b/src/android/camera_device.h\n> index 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> -- \n> 2.29.2\n>","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 06AEAC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 22 Jan 2021 04:13:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 59B0268228;\n\tFri, 22 Jan 2021 05:13:05 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A2AB168212\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jan 2021 05:13:03 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A5B750E;\n\tFri, 22 Jan 2021 05:13:01 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VxbP7YF3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1611288783;\n\tbh=kuUrfcf+Zyzh6tv43xb/ENy9rXfjC3+nOWsn4M8sdQg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=VxbP7YF3Zl2gwoTTF/rWb8uDVL/5DQnTkYmm4S28KknkL5wOtrm5qmkASiGfygQ6Y\n\tkvqXJHzMXaMXX4C73aZxfgdJ5u9kEy3yonqioupOrK5OPBEDYsEDttLsRlKTWaOWtY\n\tm3UvQRT1fY9FJmZC27QmPKgfDn1H5cy5TUYFF/sI=","Date":"Fri, 22 Jan 2021 13:12:55 +0900","From":"paul.elder@ideasonboard.com","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20210122041255.GG1943@pyrite.rasen.tech>","References":"<20210121165305.367801-1-jacopo@jmondi.org>\n\t<20210121165305.367801-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210121165305.367801-6-jacopo@jmondi.org>","Subject":"Re: [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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}}]