Patch Detail
Show a patch.
GET /api/1.1/patches/11405/?format=api
{ "id": 11405, "url": "https://patchwork.libcamera.org/api/1.1/patches/11405/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11405/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210226132932.165484-13-jacopo@jmondi.org>", "date": "2021-02-26T13:29:32", "name": "[libcamera-devel,12/12] android: mm: Provide helper macro for PIMPL", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "71cebe70a79493e025f5cc91cbc4597abe21509a", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11405/mbox/", "series": [ { "id": 1731, "url": "https://patchwork.libcamera.org/api/1.1/series/1731/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1731", "date": "2021-02-26T13:29:20", "name": "android: Support memory backends", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1731/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11405/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11405/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 6DAB7BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Feb 2021 13:29:24 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 403A368A87;\n\tFri, 26 Feb 2021 14:29:24 +0100 (CET)", "from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A05368A7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Feb 2021 14:29:18 +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 relay12.mail.gandi.net (Postfix) with ESMTPSA id E5994200007\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Feb 2021 13:29:17 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 26 Feb 2021 14:29:32 +0100", "Message-Id": "<20210226132932.165484-13-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.30.0", "In-Reply-To": "<20210226132932.165484-1-jacopo@jmondi.org>", "References": "<20210226132932.165484-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 12/12] 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>", "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 | 31 +++++++++++++++++++\n src/android/mm/android_generic_buffer.cpp | 35 +---------------------\n src/android/mm/cros_cbm.cpp | 36 +----------------------\n 3 files changed, 33 insertions(+), 69 deletions(-)", "diff": "diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h\nindex b251e4514864..e7f50a4622f9 100644\n--- a/src/android/camera_buffer.h\n+++ b/src/android/camera_buffer.h\n@@ -30,4 +30,35 @@ private:\n \tCameraBufferImpl *impl_;\n };\n \n+#define CAMERA_BUFFER_PIMPL\t\t\t\t\t\t\t\\\n+\tCameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)\t\\\n+\t\t: impl_(new CameraBuffer::CameraBufferImpl(camera3Buffer,\t\\\n+\t\t\t\t\t\t\t flags))\t\t\\\n+\t{\t\t\t\t\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\t\\\n+\tCameraBuffer::~CameraBuffer()\t\t\t\t\t\t\\\n+\t{ \\\n+\t\tdelete impl_; \\\n+\t} \\\n+\tbool CameraBuffer::isValid() const \\\n+\t{\t\t\t\t\t\t\t\t\t\\\n+\t\treturn impl_->isValid();\t\t\t\t\t\\\n+\t} \\\n+\tunsigned int CameraBuffer::numPlanes() const \\\n+\t{ \\\n+\t\treturn impl_->numPlanes();\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\t\\\n+\tssize_t CameraBuffer::planeSize(unsigned int plane) const \\\n+\t{ \\\n+\t\treturn impl_->planeSize(plane); \\\n+\t} \\\n+\tconst uint8_t *CameraBuffer::plane(unsigned int plane) const \\\n+\t{ \\\n+\t\treturn impl_->plane(plane); \\\n+\t} \\\n+\tuint8_t *CameraBuffer::plane(unsigned int plane) \\\n+\t{ \\\n+\t\treturn impl_->plane(plane); \\\n+\t}\n+\n #endif /* __ANDROID_CAMERA_BUFFER_H__ */\ndiff --git a/src/android/mm/android_generic_buffer.cpp b/src/android/mm/android_generic_buffer.cpp\nindex 10a43a61bd4d..2f532be83cc9 100644\n--- a/src/android/mm/android_generic_buffer.cpp\n+++ b/src/android/mm/android_generic_buffer.cpp\n@@ -89,37 +89,4 @@ uint8_t *CameraBuffer::CameraBufferImpl::plane(unsigned int plane)\n \treturn maps_[plane].data();\n }\n \n-CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)\n-\t: impl_(new CameraBuffer::CameraBufferImpl(camera3Buffer, flags))\n-{\n-}\n-\n-CameraBuffer::~CameraBuffer()\n-{\n-\tdelete impl_;\n-}\n-\n-bool CameraBuffer::isValid() const\n-{\n-\treturn impl_->isValid();\n-}\n-\n-unsigned int CameraBuffer::numPlanes() const\n-{\n-\treturn impl_->numPlanes();\n-}\n-\n-ssize_t CameraBuffer::planeSize(unsigned int plane) const\n-{\n-\treturn impl_->planeSize(plane);\n-}\n-\n-const uint8_t *CameraBuffer::plane(unsigned int plane) const\n-{\n-\treturn impl_->plane(plane);\n-}\n-\n-uint8_t *CameraBuffer::plane(unsigned int plane)\n-{\n-\treturn impl_->plane(plane);\n-}\n+CAMERA_BUFFER_PIMPL\ndiff --git a/src/android/mm/cros_cbm.cpp b/src/android/mm/cros_cbm.cpp\nindex 6c931c99d2d0..ad18aede663a 100644\n--- a/src/android/mm/cros_cbm.cpp\n+++ b/src/android/mm/cros_cbm.cpp\n@@ -130,38 +130,4 @@ uint8_t *CameraBuffer::CameraBufferImpl::plane(unsigned int plane)\n \treturn static_cast<uint8_t *>(addr);\n }\n \n-CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)\n-\t: impl_(new CameraBuffer::CameraBufferImpl(camera3Buffer, flags))\n-{\n-}\n-\n-CameraBuffer::~CameraBuffer()\n-{\n-\tdelete impl_;\n-}\n-\n-bool CameraBuffer::isValid() const\n-{\n-\treturn impl_->isValid();\n-}\n-\n-unsigned int CameraBuffer::numPlanes() const\n-{\n-\treturn impl_->numPlanes();\n-}\n-\n-ssize_t CameraBuffer::planeSize(unsigned int plane) const\n-{\n-\treturn impl_->planeSize(plane);\n-}\n-\n-const uint8_t *CameraBuffer::plane(unsigned int plane) const\n-{\n-\treturn impl_->plane(plane);\n-}\n-\n-uint8_t *CameraBuffer::plane(unsigned int plane)\n-{\n-\treturn impl_->plane(plane);\n-}\n-\n+CAMERA_BUFFER_PIMPL\n", "prefixes": [ "libcamera-devel", "12/12" ] }