[{"id":19623,"web_url":"https://patchwork.libcamera.org/comment/19623/","msgid":"<YT6TjPqaYN0gEzlW@pendragon.ideasonboard.com>","date":"2021-09-12T23:55:56","subject":"Re: [libcamera-devel] [PATCH v2 2/9] camera_device: Remove private\n\tscope of Camera3RequestDescriptor","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\nOn Fri, Sep 10, 2021 at 12:36:31PM +0530, Umang Jain wrote:\n> Camera3RequestDescriptor is a utility structure that groups information\n> about a capture request. It can be and will be extended to preserve the\n> context of a capture overall. Since the context of a capture needs to\n> be shared among other classes(for e.g. CameraStream) having a private\n\ns/classes(/classes (/\n\nDo I need to add a specific check to checkstyle.py ? :-)\n\n> definition of the struct doesn't help. Hence, de-scope the structure\n> so that it can be shared with other components (through references or\n> pointers).\n> \n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/android/camera_device.cpp |  2 +-\n>  src/android/camera_device.h   | 29 +++++++++++++++--------------\n>  2 files changed, 16 insertions(+), 15 deletions(-)\n> \n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index f2f36f32..0840c056 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -220,7 +220,7 @@ bool validateCropRotate(const camera3_stream_configuration_t &streamList)\n>   * later re-used at request complete time to notify the framework.\n>   */\n>  \n> -CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor(\n> +Camera3RequestDescriptor::Camera3RequestDescriptor(\n>  \tCamera *camera, const camera3_capture_request_t *camera3Request)\n>  {\n>  \tframeNumber_ = camera3Request->frame_number;\n> diff --git a/src/android/camera_device.h b/src/android/camera_device.h\n> index a5576927..b59ac3e7 100644\n> --- a/src/android/camera_device.h\n> +++ b/src/android/camera_device.h\n> @@ -33,6 +33,21 @@\n>  #include \"jpeg/encoder.h\"\n>  \n>  struct CameraConfigData;\n> +\n> +struct Camera3RequestDescriptor {\n> +\tCamera3RequestDescriptor() = default;\n> +\t~Camera3RequestDescriptor() = default;\n> +\tCamera3RequestDescriptor(libcamera::Camera *camera,\n> +\t\t\t\t const camera3_capture_request_t *camera3Request);\n> +\tCamera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default;\n> +\n> +\tuint32_t frameNumber_ = 0;\n> +\tstd::vector<camera3_stream_buffer_t> buffers_;\n> +\tstd::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;\n> +\tCameraMetadata settings_;\n> +\tstd::unique_ptr<CaptureRequest> request_;\n> +};\n> +\n>  class CameraDevice : protected libcamera::Loggable\n>  {\n>  public:\n> @@ -71,20 +86,6 @@ private:\n>  \n>  \tCameraDevice(unsigned int id, std::shared_ptr<libcamera::Camera> camera);\n>  \n> -\tstruct Camera3RequestDescriptor {\n> -\t\tCamera3RequestDescriptor() = default;\n> -\t\t~Camera3RequestDescriptor() = default;\n> -\t\tCamera3RequestDescriptor(libcamera::Camera *camera,\n> -\t\t\t\t\t const camera3_capture_request_t *camera3Request);\n> -\t\tCamera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default;\n> -\n> -\t\tuint32_t frameNumber_ = 0;\n> -\t\tstd::vector<camera3_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>  \tenum class State {\n>  \t\tStopped,\n>  \t\tFlushing,","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 2793EBDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 12 Sep 2021 23:56:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DAC1969184;\n\tMon, 13 Sep 2021 01:56:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A6B360250\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Sep 2021 01:56:21 +0200 (CEST)","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 9DCE69E;\n\tMon, 13 Sep 2021 01:56:20 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"wQMCJyl+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631490980;\n\tbh=plvdThdN33yvO7p4McGVhXAxw2Eix2ZIuOgJcgOcfYo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=wQMCJyl+PtRVsz4Ln7Hg3maUUY2W3C36kVStW0MWtG8gEGfOY3mEtHStNFqkx6wen\n\tre/b5rCNa8y+HjDhMikWOy589qjuaK0e/feTvmXhs/Mn4fSG5jZIKuEgh9h7j7NFlM\n\tnAnGkSTSKHRD7XUJEquQTzsQgcV3+fgQWrwa+a64=","Date":"Mon, 13 Sep 2021 02:55:56 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<YT6TjPqaYN0gEzlW@pendragon.ideasonboard.com>","References":"<20210910070638.467294-1-umang.jain@ideasonboard.com>\n\t<20210910070638.467294-3-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210910070638.467294-3-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 2/9] camera_device: Remove private\n\tscope of Camera3RequestDescriptor","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]