{"id":11427,"url":"https://patchwork.libcamera.org/api/1.1/patches/11427/?format=json","web_url":"https://patchwork.libcamera.org/patch/11427/","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":"<20210301150111.61791-10-jacopo@jmondi.org>","date":"2021-03-01T15:01:10","name":"[libcamera-devel,09/10] android: mm: Provide helper macro for PIMPL","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"5ebbe5d005de3211703efc0cdb1806316ff8fb82","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11427/mbox/","series":[{"id":1735,"url":"https://patchwork.libcamera.org/api/1.1/series/1735/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1735","date":"2021-03-01T15:01:01","name":"Support memory backends","version":1,"mbox":"https://patchwork.libcamera.org/series/1735/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11427/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11427/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 7211EBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Mar 2021 15:01:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4D5C668A7D;\n\tMon,  1 Mar 2021 16:01:08 +0100 (CET)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3304F68A94\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Mar 2021 16:01:07 +0100 (CET)","from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id DDCDD40003;\n\tMon,  1 Mar 2021 15:01:05 +0000 (UTC)"],"X-Originating-IP":"93.61.96.190","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  1 Mar 2021 16:01:10 +0100","Message-Id":"<20210301150111.61791-10-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.30.0","In-Reply-To":"<20210301150111.61791-1-jacopo@jmondi.org>","References":"<20210301150111.61791-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 09/10] android: mm: Provide helper macro\n\tfor PIMPL","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>","Cc":"Han-lin Chen <hanlinchen@chromium.org>,\n\tDaniel Hung-yu Wu <hywu@google.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Each memory backend has to declare a CameraBuffer class implementation\nthat bridges the API calls to each CameraBufferImpl implementation.\n\nAs the code is likely the same for most (if not all) backends, provide\na convenience macro that expands to the CameraBuffer class declaration.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_buffer.h              | 28 ++++++++++++++++++++\n src/android/mm/generic_camera_buffer.cpp | 33 +-----------------------\n 2 files changed, 29 insertions(+), 32 deletions(-)","diff":"diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h\nindex 2311cdaf96b2..ea73bf5b0ede 100644\n--- a/src/android/camera_buffer.h\n+++ b/src/android/camera_buffer.h\n@@ -28,4 +28,32 @@ public:\n \tlibcamera::Span<uint8_t> plane(unsigned int plane);\n };\n \n+#define PUBLIC_CAMERA_BUFFER\t\t\t\t\t\t\\\n+CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)\t\\\n+\t: Extensible(new Private(this, camera3Buffer, flags))\t\t\\\n+{                                                                       \\\n+}\t\t\t\t\t\t\t\t\t\\\n+CameraBuffer::~CameraBuffer()                                           \\\n+{\t\t\t\t\t\t\t\t\t\\\n+}\t\t\t\t\t\t\t                \\\n+bool CameraBuffer::isValid() const\t\t\t\t        \\\n+{                                                                       \\\n+\tconst Private *const d = LIBCAMERA_D_PTR();                     \\\n+\treturn d->isValid();                                            \\\n+}\t\t\t\t\t\t\t\t\t\\\n+unsigned int CameraBuffer::numPlanes() const                            \\\n+{                                                                       \\\n+\tconst Private *const d = LIBCAMERA_D_PTR();                     \\\n+\treturn d->numPlanes();                                          \\\n+}                                                                       \\\n+Span<const uint8_t> CameraBuffer::plane(unsigned int plane) const            \\\n+{\t\t\t\t\t\t\t\t\t\\\n+\tconst Private *const d = LIBCAMERA_D_PTR();                     \\\n+\treturn d->plane(plane);                                         \\\n+}                                                                       \\\n+Span<uint8_t> CameraBuffer::plane(unsigned int plane)                        \\\n+{                                                                       \\\n+\tPrivate *const d = LIBCAMERA_D_PTR();\t\t\t\t\\\n+\treturn d->plane(plane);\t\t\t\t\t\t\\\n+}\n #endif /* __ANDROID_CAMERA_BUFFER_H__ */\ndiff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp\nindex ea85be805260..5ea1339bc0ec 100644\n--- a/src/android/mm/generic_camera_buffer.cpp\n+++ b/src/android/mm/generic_camera_buffer.cpp\n@@ -86,35 +86,4 @@ Span<uint8_t> CameraBuffer::Private::plane(unsigned int plane)\n \treturn maps_[plane];\n }\n \n-CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)\n-\t: Extensible(new Private(this, camera3Buffer, flags))\n-{\n-}\n-\n-CameraBuffer::~CameraBuffer()\n-{\n-}\n-\n-bool CameraBuffer::isValid() const\n-{\n-\tconst Private *const d = LIBCAMERA_D_PTR();\n-\treturn d->isValid();\n-}\n-\n-unsigned int CameraBuffer::numPlanes() const\n-{\n-\tconst Private *const d = LIBCAMERA_D_PTR();\n-\treturn d->numPlanes();\n-}\n-\n-Span<const uint8_t> CameraBuffer::plane(unsigned int plane) const\n-{\n-\tconst Private *const d = LIBCAMERA_D_PTR();\n-\treturn d->plane(plane);\n-}\n-\n-Span<uint8_t> CameraBuffer::plane(unsigned int plane)\n-{\n-\tPrivate *const d = LIBCAMERA_D_PTR();\n-\treturn d->plane(plane);\n-}\n+PUBLIC_CAMERA_BUFFER\n","prefixes":["libcamera-devel","09/10"]}