{"id":14789,"url":"https://patchwork.libcamera.org/api/patches/14789/?format=json","web_url":"https://patchwork.libcamera.org/patch/14789/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20211126034150.1843285-1-hiroh@chromium.org>","date":"2021-11-26T03:41:49","name":"[libcamera-devel,v4,1/2] libcamera: framebuffer: Enable attaching additional data to FrameBuffer","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"8db6dc3ff745ff689c51e7049a5824ac40416429","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14789/mbox/","series":[{"id":2758,"url":"https://patchwork.libcamera.org/api/series/2758/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2758","date":"2021-11-26T03:41:49","name":"[libcamera-devel,v4,1/2] libcamera: framebuffer: Enable attaching additional data to FrameBuffer","version":4,"mbox":"https://patchwork.libcamera.org/series/2758/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14789/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14789/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 A1ED9BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Nov 2021 03:42:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D86856049B;\n\tFri, 26 Nov 2021 04:41:59 +0100 (CET)","from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com\n\t[IPv6:2607:f8b0:4864:20::102a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E19B6011D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Nov 2021 04:41:57 +0100 (CET)","by mail-pj1-x102a.google.com with SMTP id\n\tp18-20020a17090ad31200b001a78bb52876so8987791pju.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Nov 2021 19:41:57 -0800 (PST)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:139c:952e:8861:d909])\n\tby smtp.gmail.com with ESMTPSA id\n\tt4sm4500697pfj.168.2021.11.25.19.41.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 25 Nov 2021 19:41:55 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"WOUYZVwW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=6QK1MyRb7UCtu8CYpX8LC3RrUZlA00Qlxu6YEFO7ek8=;\n\tb=WOUYZVwWlNSuefs3QW0fuAVPgEKJGrbRBNd6nmBMIJIWN+gRQgBnAEKRJXm35+15KQ\n\t7y9+c/bHUi/wHPDeiFV465zThzeSeKO8+wzj+A89lSskNycrkksbKGriISnCjV4fxTD3\n\tEoi9YYYOrr+hSPiQcEIXdmUnuG5CP7jJn+s0w=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=6QK1MyRb7UCtu8CYpX8LC3RrUZlA00Qlxu6YEFO7ek8=;\n\tb=Xe7/FglLXgVCXargjY38xS5aTGFahtnuL9X3lvAuJFSN3Y3b0xCSjr+Cc/qMFpBDOE\n\tiKaNYuPWfx4xhmPbKX1oXd5wRGUOXV6y0b6I16G4LmngoRdm5RunRY0QJxI1wOGQUy8+\n\tIUtbkfazxCLW37T8uv5NiPdybMnhy1VZ3c0JOt7sQOD6aNSJVhX6UI46BDPDjZcMgVBh\n\tpYVkZ4CD+lKz+23VHLgjToauP1fNJRqo5FgjHCUBhffX7/K/dThhVWwmLNSzzC9O02Ga\n\tSyTTgJwxVntFzU1JKNfx3vhf8IeyuHOvWuaOyfo4xZhtiSe3iJssxKmWlGXLFNCfhk5n\n\tvwfw==","X-Gm-Message-State":"AOAM5330/l4pAzLvzoB3fu9NjnhCF5rDIp5FVRWELIalnDzo7tl6a+3t\n\t8et83LlRQUpEg7InjKHqAJn4eIfXZpVepA==","X-Google-Smtp-Source":"ABdhPJwMkhlkyJEQz6Bhxblp9HGvAIzyt0c/nltHGzYYOWLCIdRACddc9SaKkjgsc2ChRPgIbub7hA==","X-Received":"by 2002:a17:902:e885:b0:142:1500:d2ba with SMTP id\n\tw5-20020a170902e88500b001421500d2bamr35160123plg.19.1637898115630; \n\tThu, 25 Nov 2021 19:41:55 -0800 (PST)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 26 Nov 2021 12:41:49 +0900","Message-Id":"<20211126034150.1843285-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.34.0.rc2.393.gf8c9666880-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 1/2] libcamera: framebuffer: Enable\n\tattaching additional data to FrameBuffer","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":"We cannot have a subclass of FrameBuffer because it is marked as final.\nThis adds a FrameBuffer constructor with FrameBuffer::Private. So we\ncan attach some additional resources with FrameBuffer through a\ncustomized FrameBuffer::Private class.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/framebuffer.h          |  2 ++\n include/libcamera/internal/framebuffer.h |  1 +\n src/libcamera/framebuffer.cpp            | 24 ++++++++++++++++++++++--\n 3 files changed, 25 insertions(+), 2 deletions(-)","diff":"diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\nindex 7f2f176a..abcede31 100644\n--- a/include/libcamera/framebuffer.h\n+++ b/include/libcamera/framebuffer.h\n@@ -58,6 +58,8 @@ public:\n \t};\n \n \tFrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);\n+\tFrameBuffer(std::unique_ptr<Private> d,\n+\t\t    const std::vector<Plane> &planes, unsigned int cookie = 0);\n \n \tconst std::vector<Plane> &planes() const { return planes_; }\n \tRequest *request() const;\ndiff --git a/include/libcamera/internal/framebuffer.h b/include/libcamera/internal/framebuffer.h\nindex cd33c295..3cced5b1 100644\n--- a/include/libcamera/internal/framebuffer.h\n+++ b/include/libcamera/internal/framebuffer.h\n@@ -19,6 +19,7 @@ class FrameBuffer::Private : public Extensible::Private\n \n public:\n \tPrivate();\n+\tvirtual ~Private();\n \n \tvoid setRequest(Request *request) { request_ = request; }\n \tbool isContiguous() const { return isContiguous_; }\ndiff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\nindex 337ea115..3a324471 100644\n--- a/src/libcamera/framebuffer.cpp\n+++ b/src/libcamera/framebuffer.cpp\n@@ -116,6 +116,13 @@ FrameBuffer::Private::Private()\n {\n }\n \n+/**\n+ * \\brief FrameBuffer::Private destructor\n+ */\n+FrameBuffer::Private::~Private()\n+{\n+}\n+\n /**\n  * \\fn FrameBuffer::Private::setRequest()\n  * \\brief Set the request this buffer belongs to\n@@ -213,8 +220,21 @@ FrameBuffer::Private::Private()\n  * \\param[in] cookie Cookie\n  */\n FrameBuffer::FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie)\n-\t: Extensible(std::make_unique<Private>()), planes_(planes),\n-\t  cookie_(cookie)\n+\t: FrameBuffer(std::make_unique<Private>(), planes, cookie)\n+{\n+}\n+\n+/**\n+ * \\brief Construct a FrameBuffer with an extensible private class and an array\n+ * of planes\n+ * \\param[in] d The extensible private class\n+ * \\param[in] planes The frame memory planes\n+ * \\param[in] cookie Cookie\n+ */\n+FrameBuffer::FrameBuffer(std::unique_ptr<Private> d,\n+\t\t\t const std::vector<Plane> &planes,\n+\t\t\t unsigned int cookie)\n+\t: Extensible(std::move(d)), planes_(planes), cookie_(cookie)\n {\n \tmetadata_.planes_.resize(planes_.size());\n \n","prefixes":["libcamera-devel","v4","1/2"]}