Patch Detail
Show a patch.
GET /api/patches/11426/?format=api
{ "id": 11426, "url": "https://patchwork.libcamera.org/api/patches/11426/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11426/", "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": "<20210301150111.61791-9-jacopo@jmondi.org>", "date": "2021-03-01T15:01:09", "name": "[libcamera-devel,08/10] android: jpeg: Use maxJpegBufferSize() for compatibility", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "8e7d389f526fad3b8cb2ed869d467307cfaa33bf", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11426/mbox/", "series": [ { "id": 1735, "url": "https://patchwork.libcamera.org/api/series/1735/?format=api", "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/11426/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11426/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 411DFBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 1 Mar 2021 15:01:07 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1E28368A91;\n\tMon, 1 Mar 2021 16:01:07 +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 AAD4668A69\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 1 Mar 2021 16:01:05 +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 8A34340018;\n\tMon, 1 Mar 2021 15:01:03 +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:09 +0100", "Message-Id": "<20210301150111.61791-9-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 08/10] android: jpeg: Use\n\tmaxJpegBufferSize() for compatibility", "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": "Platforms that do not provide a memory backend implementation should\nkeep using the maxJpegBufferSize() value to calculate the location where\nto place the JPEG blob id, as the android_generic backend returns the\nallocated buffer size as calculated using lseek which is larger than\nthe maximum JPEG frame size, which is where the framework expects the\nJPEG blob to be placed.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/jpeg/post_processor_jpeg.cpp | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex 83244ce6769e..65ab6b196ad1 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -182,8 +182,16 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \t}\n \n \t/* Fill in the JPEG blob header. */\n-\tuint8_t *resultPtr = destination->plane(0).data()\n-\t\t\t + destination->plane(0).size()\n+\t/*\n+\t * \\todo For backward compatibility reasons with the android_generic\n+\t * memory backend, continue using the maxJpegBufferSize in case the\n+\t * computed buffer size is larger. This can be dropped once all\n+\t * supported platforms will have a working memory backend that\n+\t * returns the correct buffer size.\n+\t */\n+\tsize_t blobSize = std::min<unsigned int>(cameraDevice_->maxJpegBufferSize(),\n+\t\t\t\t\t\t destination->plane(0).size());\n+\tuint8_t *resultPtr = destination->plane(0).data() + blobSize\n \t\t\t - sizeof(struct camera3_jpeg_blob);\n \tauto *blob = reinterpret_cast<struct camera3_jpeg_blob *>(resultPtr);\n \tblob->jpeg_blob_id = CAMERA3_JPEG_BLOB_ID;\n", "prefixes": [ "libcamera-devel", "08/10" ] }