Patch Detail
Show a patch.
GET /api/patches/14370/?format=api
{ "id": 14370, "url": "https://patchwork.libcamera.org/api/patches/14370/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14370/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20211027141623.422927-1-umang.jain@ideasonboard.com>", "date": "2021-10-27T14:16:23", "name": "[libcamera-devel,v2] android: Camera3RequestDescriptor: Provide a constructor for StreamBuffer", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f1fda2f6733b9767a0aed7f787af521de234a8d9", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14370/mbox/", "series": [ { "id": 2667, "url": "https://patchwork.libcamera.org/api/series/2667/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2667", "date": "2021-10-27T14:16:23", "name": "[libcamera-devel,v2] android: Camera3RequestDescriptor: Provide a constructor for StreamBuffer", "version": 2, "mbox": "https://patchwork.libcamera.org/series/2667/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14370/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14370/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 E4DB2BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 14:16:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 386AA64882;\n\tWed, 27 Oct 2021 16:16:31 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB27360123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 16:16:29 +0200 (CEST)", "from perceval.ideasonboard.com (unknown [103.251.226.211])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AFD20276;\n\tWed, 27 Oct 2021 16:16:28 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WdMEgqMw\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635344189;\n\tbh=PvfxNO13JhsEoCFDo6zOBGWBYINY6M+SJfKCjpObs0M=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=WdMEgqMw5dhrBYMhtbkfqm20h2r84KONbFMk4Pz8TLE70femZ54+zr2S2/eW7OB7P\n\th97plZqGlMQMv5zmKoMn7kqu3D8tvlaFih5z/9d2AYRaSzB8WsGb/vaq5sURl5HsqO\n\tZxrFOXBYn99WY67qJJV5RyE8M/QJfYh2ytiVc1ic=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 27 Oct 2021 19:46:23 +0530", "Message-Id": "<20211027141623.422927-1-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2] android: Camera3RequestDescriptor:\n\tProvide a constructor for StreamBuffer", "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": "Provide a constructor for StreamBuffer and use that while populating\nCamera3RequestDescriptor::buffers_ vector. Also provide the default\nmove-constructor (required as StreamBuffer is stored in a vector in\nCamera3RequestDescriptor) and destructor for the StreamBuffer struct.\n\nAlso declare a default move assignment operator and disable the\ncopy constructor and move operator explicitly with\nLIBCAMERA_DISABLE_COPY().\n\nWhile at it, initialize pointers members in the StreamBuffer struct\nto nullptr, with StreamBuffer::status set to Status::Success.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\nChanges in v2:\n - Declare default move-assignment operator which is then explicitly\n disabled by LIBCAMERA_DISABLE_MOVE() macro along with copy\n constructor (enforced by the macro).\n---\n src/android/camera_request.cpp | 16 +++++++++++++---\n src/android/camera_request.h | 16 +++++++++++++---\n 2 files changed, 26 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/android/camera_request.cpp b/src/android/camera_request.cpp\nindex 5bac1b8f..0b2946fb 100644\n--- a/src/android/camera_request.cpp\n+++ b/src/android/camera_request.cpp\n@@ -37,9 +37,7 @@ Camera3RequestDescriptor::Camera3RequestDescriptor(\n \t\tCameraStream *stream =\n \t\t\tstatic_cast<CameraStream *>(buffer.stream->priv);\n \n-\t\tbuffers_.push_back({ stream, buffer.buffer, nullptr,\n-\t\t\t\t buffer.acquire_fence, Status::Success,\n-\t\t\t\t nullptr, nullptr, nullptr, this });\n+\t\tbuffers_.emplace_back(stream, buffer, this);\n \t}\n \n \t/* Clone the controls associated with the camera3 request. */\n@@ -54,3 +52,15 @@ Camera3RequestDescriptor::Camera3RequestDescriptor(\n }\n \n Camera3RequestDescriptor::~Camera3RequestDescriptor() = default;\n+\n+Camera3RequestDescriptor::StreamBuffer::StreamBuffer(\n+\tCameraStream *stream, const camera3_stream_buffer_t &buffer,\n+\tCamera3RequestDescriptor *request)\n+\t: camera3Buffer(buffer.buffer), fence(buffer.acquire_fence),\n+\t stream(stream), request(request)\n+{\n+}\n+\n+Camera3RequestDescriptor::StreamBuffer::~StreamBuffer() = default;\n+\n+Camera3RequestDescriptor::StreamBuffer::StreamBuffer(StreamBuffer &&other) = default;\ndiff --git a/src/android/camera_request.h b/src/android/camera_request.h\nindex cfafa445..618e1fc1 100644\n--- a/src/android/camera_request.h\n+++ b/src/android/camera_request.h\n@@ -34,15 +34,25 @@ public:\n \t};\n \n \tstruct StreamBuffer {\n+\t\tStreamBuffer(CameraStream *stream,\n+\t\t\t const camera3_stream_buffer_t &buffer,\n+\t\t\t Camera3RequestDescriptor *request);\n+\t\t~StreamBuffer();\n+\t\tStreamBuffer(StreamBuffer &&other);\n+\t\tStreamBuffer &operator=(StreamBuffer &&) = default;\n+\n \t\tCameraStream *stream;\n \t\tbuffer_handle_t *camera3Buffer;\n \t\tstd::unique_ptr<libcamera::FrameBuffer> frameBuffer;\n \t\tint fence;\n-\t\tStatus status;\n-\t\tlibcamera::FrameBuffer *internalBuffer;\n-\t\tconst libcamera::FrameBuffer *srcBuffer;\n+\t\tStatus status = Status::Success;\n+\t\tlibcamera::FrameBuffer *internalBuffer = nullptr;\n+\t\tconst libcamera::FrameBuffer *srcBuffer = nullptr;\n \t\tstd::unique_ptr<CameraBuffer> dstBuffer;\n \t\tCamera3RequestDescriptor *request;\n+\n+\tprivate:\n+\t\tLIBCAMERA_DISABLE_COPY(StreamBuffer)\n \t};\n \n \t/* Keeps track of streams requiring post-processing. */\n", "prefixes": [ "libcamera-devel", "v2" ] }