[{"id":19967,"web_url":"https://patchwork.libcamera.org/comment/19967/","msgid":"<20210929073124.yc3phahrlvlwmmtp@uno.localdomain>","date":"2021-09-29T07:31:24","subject":"Re: [libcamera-devel] [PATCH v3 1/3] android: camera_worker: Use\n\tCamera3RequestDescriptor as cookie","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Umang,\n\nOn Wed, Sep 29, 2021 at 12:47:06PM +0530, Umang Jain wrote:\n> Use Camera3RequestDescriptor as cookie for the Capture Request.\n> The cookie is used to lookup descriptors map in\n> CameraDevice::requestComplete(). The map will be transformed to a\n> queue in subsequent commit.\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n(I am missing why this change is required, but I welcome it as I think\nin the long term CaptureRequest should be made part of\nCamera3RequestDescriptor)\n\n> ---\n>  src/android/camera_device.cpp | 3 ++-\n>  src/android/camera_worker.cpp | 4 ++--\n>  src/android/camera_worker.h   | 3 ++-\n>  3 files changed, 6 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 0fe11fe8..9287ea07 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -244,7 +244,8 @@ CameraDevice::Camera3RequestDescriptor::Camera3RequestDescriptor(\n>  \t * Create the CaptureRequest, stored as a unique_ptr<> to tie its\n>  \t * lifetime to the descriptor.\n>  \t */\n> -\trequest_ = std::make_unique<CaptureRequest>(camera);\n> +\trequest_ = std::make_unique<CaptureRequest>(camera,\n> +\t\t\t\t\t\t    reinterpret_cast<uint64_t>(this));\n>  }\n>\n>  /*\n> diff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp\n> index 91313183..dabb3054 100644\n> --- a/src/android/camera_worker.cpp\n> +++ b/src/android/camera_worker.cpp\n> @@ -27,10 +27,10 @@ LOG_DECLARE_CATEGORY(HAL)\n>   * by the CameraWorker which queues it to the libcamera::Camera after handling\n>   * fences.\n>   */\n> -CaptureRequest::CaptureRequest(Camera *camera)\n> +CaptureRequest::CaptureRequest(Camera *camera, uint64_t cookie)\n>  \t: camera_(camera)\n>  {\n> -\trequest_ = camera_->createRequest(reinterpret_cast<uint64_t>(this));\n> +\trequest_ = camera_->createRequest(cookie);\n>  }\n>\n>  void CaptureRequest::addBuffer(Stream *stream, FrameBuffer *buffer, int fence)\n> diff --git a/src/android/camera_worker.h b/src/android/camera_worker.h\n> index 67ae50bd..c94f1632 100644\n> --- a/src/android/camera_worker.h\n> +++ b/src/android/camera_worker.h\n> @@ -8,6 +8,7 @@\n>  #define __ANDROID_CAMERA_WORKER_H__\n>\n>  #include <memory>\n> +#include <stdint.h>\n>\n>  #include <libcamera/base/object.h>\n>  #include <libcamera/base/thread.h>\n> @@ -22,7 +23,7 @@ class CameraDevice;\n>  class CaptureRequest\n>  {\n>  public:\n> -\tCaptureRequest(libcamera::Camera *camera);\n> +\tCaptureRequest(libcamera::Camera *camera, uint64_t cookie);\n>\n>  \tconst std::vector<int> &fences() const { return acquireFences_; }\n>  \tlibcamera::ControlList &controls() { return request_->controls(); }\n> --\n> 2.31.0\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 4D0DAC3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Sep 2021 07:30:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F78669191;\n\tWed, 29 Sep 2021 09:30:39 +0200 (CEST)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A18516918A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Sep 2021 09:30:37 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 3F3A560006;\n\tWed, 29 Sep 2021 07:30:36 +0000 (UTC)"],"Date":"Wed, 29 Sep 2021 09:31:24 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20210929073124.yc3phahrlvlwmmtp@uno.localdomain>","References":"<20210929071708.299946-1-umang.jain@ideasonboard.com>\n\t<20210929071708.299946-2-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210929071708.299946-2-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 1/3] android: camera_worker: Use\n\tCamera3RequestDescriptor as cookie","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>"}}]