Show a patch.

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

{
    "id": 20783,
    "url": "https://patchwork.libcamera.org/api/patches/20783/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20783/",
    "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": "<20240805135104.139932-7-chenghaoyang@google.com>",
    "date": "2024-08-05T13:48:37",
    "name": "[v8,6/8] libcamera: pipeline: Shift test pattern by 1 pixel left every frame",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "959d8956d87b1e19e72ead1ee54c9773fa64c658",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20783/mbox/",
    "series": [
        {
            "id": 4487,
            "url": "https://patchwork.libcamera.org/api/series/4487/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4487",
            "date": "2024-08-05T13:48:31",
            "name": "Add VirtualPipelineHandler",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/4487/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20783/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20783/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 C6D29BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Aug 2024 13:51:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 751796338C;\n\tMon,  5 Aug 2024 15:51:24 +0200 (CEST)",
            "from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com\n\t[IPv6:2a00:1450:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F3FBF63387\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Aug 2024 15:51:09 +0200 (CEST)",
            "by mail-wr1-x42b.google.com with SMTP id\n\tffacd0b85a97d-3684e8220f9so3150816f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Aug 2024 06:51:09 -0700 (PDT)",
            "from chenghaoyang-germany.c.googlers.com.com\n\t(49.222.77.34.bc.googleusercontent.com. [34.77.222.49])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-428e8d6555fsm137146675e9.26.2024.08.05.06.51.08\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 05 Aug 2024 06:51:08 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"iqK4Wa9h\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1722865869; x=1723470669;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=IwO+Szbax0/PsyYsuXawn4mzMae1KrfmYICm2SjNpoA=;\n\tb=iqK4Wa9hdSQoVdgJCaJ0E8zJDjtgFPKeoiW2izRANds5iqJP+guG7O0YL8B2c/gt0m\n\tX7EwfBn5p62+596jFdHBnSzQWkEw3i+6oCcTSHuG5tyPgT17AC3Cyi+hbfTg2gsgE8qk\n\tGi1H+Cc5ZpiHU/Ln3nah1bTdeKoFR4XdPeUWY=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1722865869; x=1723470669;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=IwO+Szbax0/PsyYsuXawn4mzMae1KrfmYICm2SjNpoA=;\n\tb=CX5hMdHTStrvk/byEv7Xo9heY85Kku4vrd76qaxqKvWaIMYF97Otr1mkJ6FFry9TXW\n\tfWVDboVDwQtCV/8mJwvXdr0RHQgQT0R5NX3lt0YBJEt1RU+thkgdJejvxWYoXpQXPSo3\n\tnZk6jANCS4+23evQTh7n1v5zWbV5wTCY4o9uLRTaIueRya5xLOrVNLOuT8wXIcX82DgQ\n\tDKx47Xk9UoI8hDgosIuGld+r7LabeiobbYTLXFcGPltQvubykRquokdPXPF0cXWhcyOR\n\tuyg0YHyKQfWqGrWEn2TTHh75mnvWYFBXjj60jsivvWoTrJ9XKKVuO4EK8oceuNCQj86P\n\tTNEQ==",
        "X-Gm-Message-State": "AOJu0YyuRxLsC4M5zcOaUnVtZs/lU1VdZBbnCWAIw+qISVDxmxDXoUfe\n\thqUZyM9WyhgBIdwz3kPT+X5Pe6AXwyM3efeT7+EYnCGdx4eTyGZuDRWnfT7l5LAPMQFZAL4tE1t\n\tB8//rixE=",
        "X-Google-Smtp-Source": "AGHT+IHlbYv8kW8InlDU23KP9xERoG4NOVnyDjXQbo/A/n+1DaBVK0HmQt2X4qDDiaeEd2/ARL3OPg==",
        "X-Received": "by 2002:adf:b184:0:b0:366:eadc:573f with SMTP id\n\tffacd0b85a97d-36bb35dfd67mr10031360f8f.27.1722865869166; \n\tMon, 05 Aug 2024 06:51:09 -0700 (PDT)",
        "From": "Harvey Yang <chenghaoyang@chromium.org>",
        "X-Google-Original-From": "Harvey Yang <chenghaoyang@google.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Konami Shu <konamiz@google.com>, Harvey Yang <chenghaoyang@chromium.org>,\n\tYunke Cao <yunkec@chromium.org>, Tomasz Figa <tfiga@chromium.org>",
        "Subject": "[PATCH v8 6/8] libcamera: pipeline: Shift test pattern by 1 pixel\n\tleft every frame",
        "Date": "Mon,  5 Aug 2024 13:48:37 +0000",
        "Message-ID": "<20240805135104.139932-7-chenghaoyang@google.com>",
        "X-Mailer": "git-send-email 2.46.0.rc2.264.g509ed76dc8-goog",
        "In-Reply-To": "<20240805135104.139932-1-chenghaoyang@google.com>",
        "References": "<20240805135104.139932-1-chenghaoyang@google.com>",
        "MIME-Version": "1.0",
        "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": "From: Konami Shu <konamiz@google.com>\n\n- This write the buffer every frame\n- Shifting makes the frame rate dropped from about 160 to 40\n\nPatchset1->2\n- Use constant instead of using a magic number\n\nPatchset2->3\n- Make shiftLeft() private\n\nSigned-off-by: Konami Shu <konamiz@google.com>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\nCo-developed-by: Yunke Cao <yunkec@chromium.org>\nCo-developed-by: Tomasz Figa <tfiga@chromium.org>\n---\n .../pipeline/virtual/data/virtual.yaml        |  4 +--\n .../virtual/test_pattern_generator.cpp        | 36 +++++++++++++++++++\n 2 files changed, 38 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/virtual/data/virtual.yaml b/src/libcamera/pipeline/virtual/data/virtual.yaml\nindex 4eb239e2..b8956f2d 100644\n--- a/src/libcamera/pipeline/virtual/data/virtual.yaml\n+++ b/src/libcamera/pipeline/virtual/data/virtual.yaml\n@@ -28,8 +28,8 @@\n   model: \"Virtual Video Device1\"\n \"Virtual2\":\n   supported_formats:\n-  - width: 100\n-    height: 100\n+  - width: 400\n+    height: 300\n   test_pattern: \"lines\"\n   location: \"front\"\n   model: \"Virtual Video Device2\"\ndiff --git a/src/libcamera/pipeline/virtual/test_pattern_generator.cpp b/src/libcamera/pipeline/virtual/test_pattern_generator.cpp\nindex 8dfe626e..6df9b31e 100644\n--- a/src/libcamera/pipeline/virtual/test_pattern_generator.cpp\n+++ b/src/libcamera/pipeline/virtual/test_pattern_generator.cpp\n@@ -28,6 +28,9 @@ void TestPatternGenerator::generateFrame(\n \n \tauto planes = mappedFrameBuffer.planes();\n \n+\t/* TODO: select whether to do shifting or not */\n+\tshiftLeft(size);\n+\n \t/* Convert the template_ to the frame buffer */\n \tint ret = libyuv::ARGBToNV12(\n \t\ttemplate_.get(), /*src_stride_argb=*/size.width * kARGBSize,\n@@ -39,6 +42,39 @@ void TestPatternGenerator::generateFrame(\n \t}\n }\n \n+void TestPatternGenerator::shiftLeft(const Size &size)\n+{\n+\t/* Store the first column temporarily */\n+\tuint8_t firstColumn[size.height * kARGBSize];\n+\tfor (size_t h = 0; h < size.height; h++) {\n+\t\tunsigned int index = h * size.width * kARGBSize;\n+\t\tunsigned int index1 = h * kARGBSize;\n+\t\tfirstColumn[index1] = template_[index];\n+\t\tfirstColumn[index1 + 1] = template_[index + 1];\n+\t\tfirstColumn[index1 + 2] = template_[index + 2];\n+\t\tfirstColumn[index1 + 3] = 0x00;\n+\t}\n+\n+\t/* Overwrite template_ */\n+\tuint8_t *buf = template_.get();\n+\tfor (size_t h = 0; h < size.height; h++) {\n+\t\tfor (size_t w = 0; w < size.width - 1; w++) {\n+\t\t\t/* Overwrite with the pixel on the right */\n+\t\t\tunsigned int index = (h * size.width + w + 1) * kARGBSize;\n+\t\t\t*buf++ = template_[index]; // B\n+\t\t\t*buf++ = template_[index + 1]; // G\n+\t\t\t*buf++ = template_[index + 2]; // R\n+\t\t\t*buf++ = 0x00; // A\n+\t\t}\n+\t\t/* Overwrite the new last column with the original first column */\n+\t\tunsigned int index1 = h * kARGBSize;\n+\t\t*buf++ = firstColumn[index1]; // B\n+\t\t*buf++ = firstColumn[index1 + 1]; // G\n+\t\t*buf++ = firstColumn[index1 + 2]; // R\n+\t\t*buf++ = 0x00; // A\n+\t}\n+}\n+\n std::unique_ptr<ColorBarsGenerator> ColorBarsGenerator::create()\n {\n \treturn std::make_unique<ColorBarsGenerator>();\n",
    "prefixes": [
        "v8",
        "6/8"
    ]
}