{"id":14374,"url":"https://patchwork.libcamera.org/api/patches/14374/?format=json","web_url":"https://patchwork.libcamera.org/patch/14374/","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":"<20211028073038.653786-2-hiroh@chromium.org>","date":"2021-10-28T07:30:37","name":"[libcamera-devel,1/2] libcamera: framebuffer: Enable attaching additional data to FrameBuffer","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"c1ff50e547723c60b6f4f0fa4a58a9cb76399738","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/14374/mbox/","series":[{"id":2670,"url":"https://patchwork.libcamera.org/api/series/2670/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2670","date":"2021-10-28T07:30:36","name":"Introduce PlatformFrameBufferAllocator","version":1,"mbox":"https://patchwork.libcamera.org/series/2670/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14374/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14374/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 D6354BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Oct 2021 07:30:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 94C3B600BD;\n\tThu, 28 Oct 2021 09:30:50 +0200 (CEST)","from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com\n\t[IPv6:2607:f8b0:4864:20::1030])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BB694600B9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 09:30:47 +0200 (CEST)","by mail-pj1-x1030.google.com with SMTP id in13so1650186pjb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Oct 2021 00:30:47 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:3f47:e04c:b9be:d02e])\n\tby smtp.gmail.com with ESMTPSA id\n\tb13sm6974392pjl.15.2021.10.28.00.30.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 28 Oct 2021 00:30:45 -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=\"Q8Y6KUaG\"; 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=L1BgXhB4HoFS1wxgKIGYksGwpaRix3Nmcp3i3ECMjSY=;\n\tb=Q8Y6KUaGfYwmq7IO54mqEfxTp2FIw5F56aJUS2akSvBk2qVS3q2hJ2un3kSg2KRyx1\n\t2jXsMDE3XQcXkPjbnZhJaWjx5S6KLingU8A2m3pWdcihR2hGF6rBJJEEkMNRGgd9meJQ\n\tYupqIf44Jga451rqf/nRms8QOr6WlNlri5P6g=","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=L1BgXhB4HoFS1wxgKIGYksGwpaRix3Nmcp3i3ECMjSY=;\n\tb=Mld0EDwpQsHTPN8aQQotbJUV2ZgdYxmZeVoOPspLPtRagcRircjDCdkCREVK9LOVUO\n\t9TSgQBJTL3vxqbVOEt9o5+20wh92KwlU8Pw3f5Pv7UD46rUpTV+y+unSSf0B8x3QpiPt\n\toGpk4XYQwNiioAWpGpaOI0dl6tIrAUmSHJII2MhKf1LYnTa8sMD8TZNLujyVDLpyzTqP\n\tdL0XFwVr7AQhmK0xaqMyDIBdPdHxZnvTcCFNFpxNinwRBZfniPA6TQ/+0Sc5wZJLnwwq\n\tProISo798/pl5kxmp1steilqKgCqG6OHSVoBJ1UBsKGKLo4dmdLq4QkIH5u5tkSSbMDM\n\tubjA==","X-Gm-Message-State":"AOAM530csFR36HNiGLzv4T/2G2X6CEzBK5UuWXyGuM2hzeruvrwmH3r6\n\tXRx/y+CFWdtnAH2naOO6JdZR6OH1JUIKJQ==","X-Google-Smtp-Source":"ABdhPJzMCKuzA2x+NAb6oFlirb+k/UBs4rmM5oJK1ctnkcEU4Covmtgplld3Da3Eez4lePPL7C2zmw==","X-Received":"by 2002:a17:902:70c5:b0:13f:f941:9ad6 with SMTP id\n\tl5-20020a17090270c500b0013ff9419ad6mr2448866plt.28.1635406245871; \n\tThu, 28 Oct 2021 00:30:45 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 28 Oct 2021 16:30:37 +0900","Message-Id":"<20211028073038.653786-2-hiroh@chromium.org>","X-Mailer":"git-send-email 2.33.1.1089.g2158813163f-goog","In-Reply-To":"<20211028073038.653786-1-hiroh@chromium.org>","References":"<20211028073038.653786-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 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>\n---\n include/libcamera/framebuffer.h          |  2 ++\n include/libcamera/internal/framebuffer.h |  1 +\n src/libcamera/framebuffer.cpp            | 17 +++++++++++++++--\n 3 files changed, 18 insertions(+), 2 deletions(-)","diff":"diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\nindex 7f2f176a..02bf1533 100644\n--- a/include/libcamera/framebuffer.h\n+++ b/include/libcamera/framebuffer.h\n@@ -57,6 +57,8 @@ public:\n \t\tunsigned int length;\n \t};\n \n+\tFrameBuffer(std::unique_ptr<Private> d,\n+\t\t    const std::vector<Plane> &planes, unsigned int cookie = 0);\n \tFrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);\n \n \tconst std::vector<Plane> &planes() const { return planes_; }\ndiff --git a/include/libcamera/internal/framebuffer.h b/include/libcamera/internal/framebuffer.h\nindex cd33c295..5ab9b3b2 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() = default;\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..26587ff3 100644\n--- a/src/libcamera/framebuffer.cpp\n+++ b/src/libcamera/framebuffer.cpp\n@@ -213,8 +213,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","1/2"]}