Show a patch.

GET /api/patches/13757/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 13757,
    "url": "https://patchwork.libcamera.org/api/patches/13757/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13757/",
    "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": "<20210908062316.49466-1-umang.jain@ideasonboard.com>",
    "date": "2021-09-08T06:23:16",
    "name": "[libcamera-devel] android: jpeg: Pass the thumbnail planes correctly to encoder",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b687435c1ec0a7741f6c500f3026f2e440c4a6ca",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/13757/mbox/",
    "series": [
        {
            "id": 2495,
            "url": "https://patchwork.libcamera.org/api/series/2495/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2495",
            "date": "2021-09-08T06:23:16",
            "name": "[libcamera-devel] android: jpeg: Pass the thumbnail planes correctly to encoder",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2495/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13757/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13757/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 9A7C4BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Sep 2021 06:23:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CCD866916E;\n\tWed,  8 Sep 2021 08:23:28 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C33896024C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Sep 2021 08:23:27 +0200 (CEST)",
            "from perceval.ideasonboard.com (unknown\n\t[IPv6:2409:4041:2d98:b4ea:c869:beee:1b25:d212])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A5DE6DD;\n\tWed,  8 Sep 2021 08:23:25 +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=\"RU8S8ZVR\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631082207;\n\tbh=QAt10spV6YKYvsasj6ZcZcZka7N96YvarHbTaqAyNnI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=RU8S8ZVRQslXf99rF30M47sSh6pdYjCYUW9pfhSmm8HooHgWkmfJ6blphLGkp9ybF\n\tW89slgoP9ZhtvLRX6p4Vq3AkyQ/FT39D9nk0vK2NS30ARznsUbGSiuNV1D79LiGw8k\n\tN9b4TOuOCrhRf1jvazOE/TUDk9WVPx2Kv5y30bdA=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  8 Sep 2021 11:53:16 +0530",
        "Message-Id": "<20210908062316.49466-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] android: jpeg: Pass the thumbnail planes\n\tcorrectly to encoder",
        "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": "After multi-planar support was introduced for jpeg encoding as well,\nEncoderLibJpeg::encode() expects a vector of planes as the source of\nframebuffer to be encoded. Currently, this is broken for thumbnail\nencoding as the thumbnail generated is directly passed as a single\nplane.\n\nHence, piece the thumbnail data as planes if the parent Framebuffer is\nmulti-planar. This fixes the encoding of the corresponding thumbnail.\n\nFixes: 894ca69f6043(\"android: jpeg: Support multi-planar buffers\")\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/android/jpeg/post_processor_jpeg.cpp | 17 +++++++++++------\n 1 file changed, 11 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex 68d74842..d896581f 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -66,13 +66,18 @@ void PostProcessorJpeg::generateThumbnail(const FrameBuffer &source,\n \tint ret = thumbnailEncoder_.configure(thCfg);\n \n \tif (!rawThumbnail.empty() && !ret) {\n-\t\t/*\n-\t\t * \\todo Avoid value-initialization of all elements of the\n-\t\t * vector.\n-\t\t */\n-\t\tthumbnail->resize(rawThumbnail.size());\n+\t\tstd::vector<Span<uint8_t>> thumbnailPlanes;\n+\t\tfor (int i = 0; i < source.planes().size(); i++) {\n+\t\t\tunsigned int thumbnailSize =\n+\t\t\t\ttargetSize.height * targetSize.width;\n+\t\t\tSpan<uint8_t> plane{\n+\t\t\t\trawThumbnail.data() + (i * thumbnailSize),\n+\t\t\t\tthumbnailSize\n+\t\t\t};\n+\t\t\tthumbnailPlanes.push_back(plane);\n+\t\t}\n \n-\t\tint jpeg_size = thumbnailEncoder_.encode({ rawThumbnail },\n+\t\tint jpeg_size = thumbnailEncoder_.encode(thumbnailPlanes,\n \t\t\t\t\t\t\t *thumbnail, {}, quality);\n \t\tthumbnail->resize(jpeg_size);\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}