{"id":14433,"url":"https://patchwork.libcamera.org/api/patches/14433/?format=json","web_url":"https://patchwork.libcamera.org/patch/14433/","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":"<20211101071652.107912-2-hiroh@chromium.org>","date":"2021-11-01T07:16:51","name":"[libcamera-devel,v2,1/2] libcamera: framebuffer: Enable attaching additional data to FrameBuffer","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"25d77f01394f9ed29c0b9a4682f8b235a11eb4f1","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/14433/mbox/","series":[{"id":2683,"url":"https://patchwork.libcamera.org/api/series/2683/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2683","date":"2021-11-01T07:16:50","name":"Introduce PlatformFrameBufferAllocator","version":2,"mbox":"https://patchwork.libcamera.org/series/2683/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14433/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14433/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 94C34C324E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Nov 2021 07:17:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE520600C9;\n\tMon,  1 Nov 2021 08:17:02 +0100 (CET)","from mail-pg1-x533.google.com (mail-pg1-x533.google.com\n\t[IPv6:2607:f8b0:4864:20::533])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 862BC600BD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Nov 2021 08:17:01 +0100 (CET)","by mail-pg1-x533.google.com with SMTP id 75so16468568pga.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 01 Nov 2021 00:17:01 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:3b39:f865:c90:680a])\n\tby smtp.gmail.com with ESMTPSA id\n\tg14sm11910879pgo.88.2021.11.01.00.16.58\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 01 Nov 2021 00:16:59 -0700 (PDT)"],"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=\"EAMKVYT3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=2glnQsNPM3DcbbpvdGpPNleGnA7CSlP3RH/MuoYhCnQ=;\n\tb=EAMKVYT3pA/fLIBP2+/Vix92t5SxLFT6yDIh6ysqupjpqZ4+Ur3+dRINqWz2tT0oB4\n\twcAyf5qo1yAwYjpzbmW8uJsMx/GvEtI+NolwHXcFww7WA0wDHkr7/uZBOZV/2FuJJMGJ\n\tvORwiOW+sEaJOf5kGPnPhK72BJlV6SLCaLl0g=","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:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=2glnQsNPM3DcbbpvdGpPNleGnA7CSlP3RH/MuoYhCnQ=;\n\tb=0QOi1xFXUoG7yTs6RZtP/iJ9/EQEINrOGT+lSKfP63pqlEOVdYF//H7hzKtIqkgLEN\n\tzSqtf0KsktkckXQUmXtyeQTd/zQa/ccRe1Okrj8Je75J+spAeHp6WoW7uOKmtnUL80kl\n\tV05Ilw+HB7h20HB5zXThoKGBkv7kLHQgOQffRlCjIsn0uCGuhUUmcikIFNHVTIyGypoV\n\tuNwS66/zfcv9N0qg5v5LSpof5VMHBblCWzupI6ulhwcpF5Lu4SIPVSTJ0OfW0ZSMER6l\n\tFwHV5UHOUPOVGga7OOonD3LLuHzlIjx40XLbnv6Nn6KKUD4RfWhHRg/Zb5MuHuIviwEA\n\tzj1A==","X-Gm-Message-State":"AOAM530pG5/gxGBAgcvfnRu2MGsNiMTnRMBTHbpU1muIHie9tjjHmhaw\n\tu+fcxtaaLP+jDyWDcZxAnnpyxhXxn3cUPw==","X-Google-Smtp-Source":"ABdhPJyGVrv5O0MtQRz6GON34tpRV4n8jEB0XHkxzTFVpriUXFghpdaSH9iiL6jzpNPHbG5N7GnLyQ==","X-Received":"by 2002:a63:710:: with SMTP id 16mr13096419pgh.324.1635751019898;\n\tMon, 01 Nov 2021 00:16:59 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  1 Nov 2021 16:16:51 +0900","Message-Id":"<20211101071652.107912-2-hiroh@chromium.org>","X-Mailer":"git-send-email 2.33.1.1089.g2158813163f-goog","In-Reply-To":"<20211101071652.107912-1-hiroh@chromium.org>","References":"<20211101071652.107912-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 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>\n---\n include/libcamera/framebuffer.h          |  3 +++\n include/libcamera/internal/framebuffer.h |  1 +\n src/libcamera/framebuffer.cpp            | 26 ++++++++++++++++++++++--\n 3 files changed, 28 insertions(+), 2 deletions(-)","diff":"diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\nindex 7f2f176a..98ef9d5d 100644\n--- a/include/libcamera/framebuffer.h\n+++ b/include/libcamera/framebuffer.h\n@@ -58,6 +58,9 @@ 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 \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 d44a98ba..34e6cd4d 100644\n--- a/src/libcamera/framebuffer.cpp\n+++ b/src/libcamera/framebuffer.cpp\n@@ -116,6 +116,15 @@ FrameBuffer::Private::Private()\n {\n }\n \n+/**\n+ * \\fn FrameBuffer::Private::~Private()\n+ * \\brief FrameBuffer::Private destructor\n+ *\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 +222,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","v2","1/2"]}