{"id":13970,"url":"https://patchwork.libcamera.org/api/1.1/patches/13970/?format=json","web_url":"https://patchwork.libcamera.org/patch/13970/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210928162536.227475-2-umang.jain@ideasonboard.com>","date":"2021-09-28T16:25:34","name":"[libcamera-devel,v2,1/3] android: camera_worker: Use Camera3RequestDescriptor as cookie","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"38b33396684f74af08c5cf597309fb22f732f66f","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/1.1/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/1.1/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/13970/mbox/","series":[{"id":2583,"url":"https://patchwork.libcamera.org/api/1.1/series/2583/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2583","date":"2021-09-28T16:25:33","name":"Camera3RequestDescriptors std::map => std::queue","version":2,"mbox":"https://patchwork.libcamera.org/series/2583/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13970/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13970/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 54CDDC3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Sep 2021 16:25:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 198C769191;\n\tTue, 28 Sep 2021 18:25:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4570B69188\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Sep 2021 18:25:51 +0200 (CEST)","from perceval.ideasonboard.com (unknown\n\t[IPv6:2405:204:8500:b152:4879:ab55:a9fb:2b15])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F20C13F1;\n\tTue, 28 Sep 2021 18:25:48 +0200 (CEST)"],"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=\"UCq7aZgd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1632846351;\n\tbh=vNfa2qhRsWPxTF/8397tqGlV9f54+qqMV279rgK+LCQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=UCq7aZgdjQiGNKwTbaXc9XcH0G45RtrnJJQPzlw2ZdzCD2t7i1BUOpGqR/Fi3N40d\n\tA7RhO75S1Dh655YOhC+FW6fm6CuZlCRnBY7saTsvy7snmPmIC1GXEnefHHhTFFWVSD\n\tpWd+IrXQ0nn/TqjYbPxviLa6AeCFN23k0s9Yc4ms=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 28 Sep 2021 21:55:34 +0530","Message-Id":"<20210928162536.227475-2-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20210928162536.227475-1-umang.jain@ideasonboard.com>","References":"<20210928162536.227475-1-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Use Camera3RequestDescriptor as cookie for the Capture Request.\nThe cookie is used to lookup descriptors map in\nCameraDevice::requestComplete(). The map will be transformed to a\nqueue in subsequent commit.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\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(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 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 /*\ndiff --git a/src/android/camera_worker.cpp b/src/android/camera_worker.cpp\nindex 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)\ndiff --git a/src/android/camera_worker.h b/src/android/camera_worker.h\nindex 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","prefixes":["libcamera-devel","v2","1/3"]}