{"id":14661,"url":"https://patchwork.libcamera.org/api/patches/14661/?format=json","web_url":"https://patchwork.libcamera.org/patch/14661/","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":"<20211119150421.974848-1-dorota.czaplejewicz@puri.sm>","date":"2021-11-19T15:05:58","name":"[libcamera-devel] FrameBuffer: Make FrameBuffer::cancel private","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"0723618b1778b86dd93bdffb26591f58072e231a","submitter":{"id":96,"url":"https://patchwork.libcamera.org/api/people/96/?format=json","name":"Dorota Czaplejewicz","email":"dorota.czaplejewicz@puri.sm"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14661/mbox/","series":[{"id":2737,"url":"https://patchwork.libcamera.org/api/series/2737/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2737","date":"2021-11-19T15:05:58","name":"[libcamera-devel] FrameBuffer: Make FrameBuffer::cancel private","version":1,"mbox":"https://patchwork.libcamera.org/series/2737/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14661/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14661/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 058CDBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Nov 2021 15:06:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 345E660371;\n\tFri, 19 Nov 2021 16:06:15 +0100 (CET)","from comms.puri.sm (comms.puri.sm [159.203.221.185])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D175600B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Nov 2021 16:06:13 +0100 (CET)","from localhost (localhost [127.0.0.1])\n\tby comms.puri.sm (Postfix) with ESMTP id 7B7CEDFE3F;\n\tFri, 19 Nov 2021 07:06:11 -0800 (PST)","from comms.puri.sm ([127.0.0.1])\n\tby localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Koj4PoYKZs8s; Fri, 19 Nov 2021 07:06:10 -0800 (PST)"],"Date":"Fri, 19 Nov 2021 16:05:58 +0100","From":"Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>","To":"Librem5-team <librem5-team@lists.puri.sm>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<20211119150421.974848-1-dorota.czaplejewicz@puri.sm>","Organization":"Purism","MIME-Version":"1.0","Content-Type":"multipart/signed; boundary=\"Sig_/cls/70_14hxOgB++oQwpq0y\";\n\tprotocol=\"application/pgp-signature\"; micalg=pgp-sha256","Subject":"[libcamera-devel] [PATCH] FrameBuffer: Make FrameBuffer::cancel\n\tprivate","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":"FrameBuffer::cancel is not meant to be used by the API consumer. It was moved to FrameBuffer::Private::cancel .\n---\nHi,\n\nI'm sending this as discussed on the mailing list.\n\nRegards,\nDorota\n\n include/libcamera/framebuffer.h                  |  2 --\n include/libcamera/internal/framebuffer.h         |  2 ++\n src/libcamera/framebuffer.cpp                    | 16 ++++++++--------\n src/libcamera/pipeline/ipu3/ipu3.cpp             |  5 +++--\n .../pipeline/raspberrypi/raspberrypi.cpp         |  2 +-\n src/libcamera/pipeline/vimc/vimc.cpp             |  3 ++-\n src/libcamera/request.cpp                        |  2 +-\n 7 files changed, 17 insertions(+), 15 deletions(-)","diff":"diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\nindex 7f2f176a..367a8a71 100644\n--- a/include/libcamera/framebuffer.h\n+++ b/include/libcamera/framebuffer.h\n@@ -66,8 +66,6 @@ public:\n \tunsigned int cookie() const { return cookie_; }\n \tvoid setCookie(unsigned int cookie) { cookie_ = cookie; }\n \n-\tvoid cancel() { metadata_.status = FrameMetadata::FrameCancelled; }\n-\n private:\n \tLIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)\n \ndiff --git a/include/libcamera/internal/framebuffer.h b/include/libcamera/internal/framebuffer.h\nindex cd33c295..27676212 100644\n--- a/include/libcamera/internal/framebuffer.h\n+++ b/include/libcamera/internal/framebuffer.h\n@@ -23,6 +23,8 @@ public:\n \tvoid setRequest(Request *request) { request_ = request; }\n \tbool isContiguous() const { return isContiguous_; }\n \n+\tvoid cancel() { LIBCAMERA_O_PTR()->metadata_.status = FrameMetadata::FrameCancelled; }\n+\n private:\n \tRequest *request_;\n \tbool isContiguous_;\ndiff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\nindex 337ea115..dd344ed8 100644\n--- a/src/libcamera/framebuffer.cpp\n+++ b/src/libcamera/framebuffer.cpp\n@@ -137,6 +137,14 @@ FrameBuffer::Private::Private()\n  * \\return True if the planes are stored contiguously in memory, false otherwise\n  */\n \n+/**\n+ * \\fn FrameBuffer::Private::cancel()\n+ * \\brief Marks the buffer as cancelled\n+ *\n+ * If a buffer is not used by a request, it shall be marked as cancelled to\n+ * indicate that the metadata is invalid.\n+ */\n+\n /**\n  * \\class FrameBuffer\n  * \\brief Frame buffer data and its associated dynamic metadata\n@@ -305,12 +313,4 @@ Request *FrameBuffer::request() const\n  * libcamera core never modifies the buffer cookie.\n  */\n \n-/**\n- * \\fn FrameBuffer::cancel()\n- * \\brief Marks the buffer as cancelled\n- *\n- * If a buffer is not used by a request, it shall be marked as cancelled to\n- * indicate that the metadata is invalid.\n- */\n-\n } /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex c65afdb2..f8516cba 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -27,6 +27,7 @@\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/delayed_controls.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n+#include \"libcamera/internal/framebuffer.h\"\n #include \"libcamera/internal/ipa_manager.h\"\n #include \"libcamera/internal/media_device.h\"\n #include \"libcamera/internal/pipeline_handler.h\"\n@@ -816,7 +817,7 @@ void IPU3CameraData::cancelPendingRequests()\n \n \t\tfor (auto it : request->buffers()) {\n \t\t\tFrameBuffer *buffer = it.second;\n-\t\t\tbuffer->cancel();\n+\t\t\tbuffer->_d()->cancel();\n \t\t\tpipe()->completeBuffer(request, buffer);\n \t\t}\n \n@@ -1333,7 +1334,7 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)\n \tif (buffer->metadata().status == FrameMetadata::FrameCancelled) {\n \t\tfor (auto it : request->buffers()) {\n \t\t\tFrameBuffer *b = it.second;\n-\t\t\tb->cancel();\n+\t\t\tb->_d()->cancel();\n \t\t\tpipe()->completeBuffer(request, b);\n \t\t}\n \ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 5e1f2273..b7cabf5e 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1573,7 +1573,7 @@ void RPiCameraData::clearIncompleteRequests()\n \t\t\t * request? If not, do so now.\n \t\t\t */\n \t\t\tif (buffer->request()) {\n-\t\t\t\tbuffer->cancel();\n+\t\t\t\tbuffer->_d()->cancel();\n \t\t\t\tpipe()->completeBuffer(request, buffer);\n \t\t\t}\n \t\t}\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex e453091d..1ec814d1 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -32,6 +32,7 @@\n #include \"libcamera/internal/camera.h\"\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n+#include \"libcamera/internal/framebuffer.h\"\n #include \"libcamera/internal/ipa_manager.h\"\n #include \"libcamera/internal/media_device.h\"\n #include \"libcamera/internal/pipeline_handler.h\"\n@@ -574,7 +575,7 @@ void VimcCameraData::bufferReady(FrameBuffer *buffer)\n \tif (buffer->metadata().status == FrameMetadata::FrameCancelled) {\n \t\tfor (auto it : request->buffers()) {\n \t\t\tFrameBuffer *b = it.second;\n-\t\t\tb->cancel();\n+\t\t\tb->_d()->cancel();\n \t\t\tpipe->completeBuffer(request, b);\n \t\t}\n \ndiff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex 17fefab7..a4dbf750 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -304,7 +304,7 @@ void Request::cancel()\n \tASSERT(status_ == RequestPending);\n \n \tfor (FrameBuffer *buffer : pending_) {\n-\t\tbuffer->cancel();\n+\t\tbuffer->_d()->cancel();\n \t\tcamera_->bufferCompleted.emit(this, buffer);\n \t}\n \n","prefixes":["libcamera-devel"]}