[{"id":19858,"web_url":"https://patchwork.libcamera.org/comment/19858/","msgid":"<CAO5uPHMyMFqo0ZvkYPk9qGPvM4hf5=JefRCpNp4muMEADJfXZQ@mail.gmail.com>","date":"2021-09-27T06:26:55","subject":"Re: [libcamera-devel] [PATCH v3 04/10] camera_device: Remove\n\tprivate scope of Camera3RequestDescriptor","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Umang, thank you for the patch.\n\nOn Tue, Sep 21, 2021 at 2:38 AM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\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> 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> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\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 cc078fe4..3d6a2bed 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>         Camera *camera, const camera3_capture_request_t *camera3Request)\n>  {\n>         frameNumber_ = camera3Request->frame_number;\n> diff --git a/src/android/camera_device.h b/src/android/camera_device.h\n> index 9c895b25..59d6cd39 100644\n> --- a/src/android/camera_device.h\n> +++ b/src/android/camera_device.h\n> @@ -34,6 +34,21 @@\n>  #include \"jpeg/encoder.h\"\n>\n>  struct CameraConfigData;\n> +\n> +struct Camera3RequestDescriptor {\n> +       Camera3RequestDescriptor() = default;\n> +       ~Camera3RequestDescriptor() = default;\n> +       Camera3RequestDescriptor(libcamera::Camera *camera,\n> +                                const camera3_capture_request_t *camera3Request);\n> +       Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default;\n> +\n> +       uint32_t frameNumber_ = 0;\n> +       std::vector<camera3_stream_buffer_t> buffers_;\n> +       std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;\n> +       CameraMetadata settings_;\n> +       std::unique_ptr<CaptureRequest> request_;\n> +};\n> +\n>  class CameraDevice : protected libcamera::Loggable\n>  {\n>  public:\n> @@ -72,20 +87,6 @@ private:\n>\n>         CameraDevice(unsigned int id, std::shared_ptr<libcamera::Camera> camera);\n>\n> -       struct Camera3RequestDescriptor {\n> -               Camera3RequestDescriptor() = default;\n> -               ~Camera3RequestDescriptor() = default;\n> -               Camera3RequestDescriptor(libcamera::Camera *camera,\n> -                                        const camera3_capture_request_t *camera3Request);\n> -               Camera3RequestDescriptor &operator=(Camera3RequestDescriptor &&) = default;\n> -\n> -               uint32_t frameNumber_ = 0;\n> -               std::vector<camera3_stream_buffer_t> buffers_;\n> -               std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;\n> -               CameraMetadata settings_;\n> -               std::unique_ptr<CaptureRequest> request_;\n> -       };\n> -\n>         enum class State {\n>                 Stopped,\n>                 Flushing,\n> --\n> 2.31.1\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 BF9FBBF01C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Sep 2021 06:27:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 149F16918E;\n\tMon, 27 Sep 2021 08:27:09 +0200 (CEST)","from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com\n\t[IPv6:2a00:1450:4864:20::52e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9CCF9684C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Sep 2021 08:27:06 +0200 (CEST)","by mail-ed1-x52e.google.com with SMTP id s17so46063130edd.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 26 Sep 2021 23:27:06 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"imSLvnEs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=KLBmOOAB6e5LOhSg5Fz7ELJDCrqUM3X9l7IHFFHI3H4=;\n\tb=imSLvnEsI5u2wGn9cbX+5Qp3qlgkc+1J44M361TdObjzcPJYfb2PzubSDHDy5JS08B\n\tlme8Vp+wWdK4brY00nE+KN+spPaOAtAVhswQ4wCu9hEY1Upm6gH56QY2PdbEzlFx7QPI\n\tQZybmDQO1CVg7RL5gW3VbPehCIfBtlp5xf1bI=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=KLBmOOAB6e5LOhSg5Fz7ELJDCrqUM3X9l7IHFFHI3H4=;\n\tb=sCcRBhUMFwLOmp3OAC/yMSMfjci1OVxwG2hSyDHW/O/5FZEf12Ug36UX0Lm/akAZne\n\tObmDqlj4flji7yij+kkDNlPBC3/f4L685PPQbECtkBzxGZ3oTbvc/qKqBScNzeRuWRjB\n\tg1o6PRVoNyrO2zXRJ1R/D4tmCqEhnUEfqp76xYVBmhfLTl+Rnaj78qv8mOGeEuBOkzdp\n\tKHn90TDKWxiHXcSd/jv5bOnijoFwsaP5/Eq50ybBeUuW7bKlknnJS49ISZzzUx04xaY1\n\tzHRur6zUEFn0Yyd0C0bpbydNXu1N29pEwYSC3X/P/ngm6AAVxZXNo3pqXN/+NZ9LcuwH\n\tSmJA==","X-Gm-Message-State":"AOAM530E91bAHrTTcFPfxeC5fsIHSvXcgUhxIpvt0ZixsEZB3rAcWd30\n\tT7Sh2ToUJ/qKDjLmoVsAPb61AJIo8SG669dkMN25PAqO+dA=","X-Google-Smtp-Source":"ABdhPJyZ0x8b0YbNCDuJQx0EIcuJ3LbHUr27kgKdgUxdXXiOf2FtCpGtt5nGCA40Jm6aDWKE3boBjB1Gf0pCtPTMFHM=","X-Received":"by 2002:a50:8161:: with SMTP id 88mr4621172edc.276.1632724026215;\n\tSun, 26 Sep 2021 23:27:06 -0700 (PDT)","MIME-Version":"1.0","References":"<20210920173752.1346190-1-umang.jain@ideasonboard.com>\n\t<20210920173752.1346190-5-umang.jain@ideasonboard.com>","In-Reply-To":"<20210920173752.1346190-5-umang.jain@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 27 Sep 2021 15:26:55 +0900","Message-ID":"<CAO5uPHMyMFqo0ZvkYPk9qGPvM4hf5=JefRCpNp4muMEADJfXZQ@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v3 04/10] camera_device: Remove\n\tprivate scope 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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]