Patch Detail
Show a patch.
GET /api/1.1/patches/27130/?format=api
{ "id": 27130, "url": "https://patchwork.libcamera.org/api/1.1/patches/27130/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27130/", "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": "<20260629163017.863145-51-barnabas.pocze@ideasonboard.com>", "date": "2026-06-29T16:30:13", "name": "[RFC,v1,50/54] android: camera_request: Add helper for buffer conversion", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "48b94f3e99c77442c43655a7e4e5a351253b174b", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/1.1/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27130/mbox/", "series": [ { "id": 6025, "url": "https://patchwork.libcamera.org/api/1.1/series/6025/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6025", "date": "2026-06-29T16:29:23", "name": "libcamera: Split requests and buffers", "version": 1, "mbox": "https://patchwork.libcamera.org/series/6025/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27130/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27130/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 BFE88C3304\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2026 16:31:42 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5588A65FDC;\n\tMon, 29 Jun 2026 18:31:42 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E15065F74\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2026 18:30:33 +0200 (CEST)", "from pb-laptop.local (185.221.140.128.nat.pool.zt.hu\n\t[185.221.140.128])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 78676E91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2026 18:29:50 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XQtUNXS3\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782750590;\n\tbh=/PVXLgJoEYbBeWCuVc9dohFWysXp3d0BxILsrqxmbQc=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=XQtUNXS3AppT2k4qGgIIv3yJ37OxGsyV81ok87QXSGFKzUXPHUeaZd+ntnlO/UWCj\n\tFU2HzQRQFIjMe7zQwqmx74QTRHknYSB9lMK94Fy8ZPFTXl7HVoqUHzY5A2/Sr4Fi0b\n\thx56xEw3W+J+lfpYZ+LOkv7l5IUNBfeFnjsUEw4s=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[RFC PATCH v1 50/54] android: camera_request: Add helper for buffer\n\tconversion", "Date": "Mon, 29 Jun 2026 18:30:13 +0200", "Message-ID": "<20260629163017.863145-51-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260629163017.863145-1-barnabas.pocze@ideasonboard.com>", "References": "<20260629163017.863145-1-barnabas.pocze@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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": "Add a function to the `StreamBuffer` type that creates an appropriate\n`camera3_stream_buffer_t` for returning it to the camera framework.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/android/camera_device.cpp | 18 ++----------------\n src/android/camera_request.cpp | 20 ++++++++++++++++++++\n src/android/camera_request.h | 2 ++\n 3 files changed, 24 insertions(+), 16 deletions(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 80ff248c2a..0d5b5b97eb 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1308,22 +1308,8 @@ void CameraDevice::sendCaptureResults()\n \t\tstd::vector<camera3_stream_buffer_t> resultBuffers;\n \t\tresultBuffers.reserve(descriptor->buffers_.size());\n \n-\t\tfor (auto &buffer : descriptor->buffers_) {\n-\t\t\tcamera3_buffer_status status = CAMERA3_BUFFER_STATUS_ERROR;\n-\n-\t\t\tif (buffer.status == Camera3RequestDescriptor::Status::Success)\n-\t\t\t\tstatus = CAMERA3_BUFFER_STATUS_OK;\n-\n-\t\t\t/*\n-\t\t\t * Pass the buffer fence back to the camera framework as\n-\t\t\t * a release fence. This instructs the framework to wait\n-\t\t\t * on the acquire fence in case we haven't done so\n-\t\t\t * ourselves for any reason.\n-\t\t\t */\n-\t\t\tresultBuffers.push_back({ buffer.stream->camera3Stream(),\n-\t\t\t\t\t\t buffer.camera3Buffer, status,\n-\t\t\t\t\t\t -1, buffer.fence.release() });\n-\t\t}\n+\t\tfor (auto &buffer : descriptor->buffers_)\n+\t\t\tresultBuffers.push_back(buffer.prepareToReturn());\n \n \t\tcaptureResult.num_output_buffers = resultBuffers.size();\n \t\tcaptureResult.output_buffers = resultBuffers.data();\ndiff --git a/src/android/camera_request.cpp b/src/android/camera_request.cpp\nindex 0d45960d90..feac7a3e19 100644\n--- a/src/android/camera_request.cpp\n+++ b/src/android/camera_request.cpp\n@@ -192,3 +192,23 @@ Camera3RequestDescriptor::StreamBuffer::StreamBuffer(StreamBuffer &&) = default;\n \n Camera3RequestDescriptor::StreamBuffer &\n Camera3RequestDescriptor::StreamBuffer::operator=(Camera3RequestDescriptor::StreamBuffer &&) = default;\n+\n+camera3_stream_buffer_t Camera3RequestDescriptor::StreamBuffer::prepareToReturn()\n+{\n+\t/*\n+\t * Pass the buffer fence back to the camera framework as\n+\t * a release fence. This instructs the framework to wait\n+\t * on the acquire fence in case we haven't done so\n+\t * ourselves for any reason.\n+\t */\n+\n+\treturn {\n+\t\t.stream = stream->camera3Stream(),\n+\t\t.buffer = camera3Buffer,\n+\t\t.status = status == Camera3RequestDescriptor::Status::Success\n+\t\t\t\t? CAMERA3_BUFFER_STATUS_OK\n+\t\t\t\t: CAMERA3_BUFFER_STATUS_ERROR,\n+\t\t.acquire_fence = -1,\n+\t\t.release_fence = fence.release(),\n+\t};\n+}\ndiff --git a/src/android/camera_request.h b/src/android/camera_request.h\nindex 5b479180f0..164b095b28 100644\n--- a/src/android/camera_request.h\n+++ b/src/android/camera_request.h\n@@ -43,6 +43,8 @@ public:\n \t\tStreamBuffer(StreamBuffer &&);\n \t\tStreamBuffer &operator=(StreamBuffer &&);\n \n+\t\t[[nodiscard]] camera3_stream_buffer_t prepareToReturn();\n+\n \t\tCameraStream *stream;\n \t\tbuffer_handle_t *camera3Buffer;\n \t\tstd::unique_ptr<HALFrameBuffer> frameBuffer;\n", "prefixes": [ "RFC", "v1", "50/54" ] }