Show a patch.

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

{
    "id": 10619,
    "url": "https://patchwork.libcamera.org/api/patches/10619/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10619/",
    "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": "<20201208205117.22204-1-david.plowman@raspberrypi.com>",
    "date": "2020-12-08T20:51:17",
    "name": "[libcamera-devel] src: pipeline: raspberrypi: Allow ScalerCrop to work when passed in Camera::start",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "dd1ab27754845ccaa4e790d50820235b9dd5b259",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10619/mbox/",
    "series": [
        {
            "id": 1516,
            "url": "https://patchwork.libcamera.org/api/series/1516/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1516",
            "date": "2020-12-08T20:51:17",
            "name": "[libcamera-devel] src: pipeline: raspberrypi: Allow ScalerCrop to work when passed in Camera::start",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1516/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10619/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10619/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 0912ABDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Dec 2020 20:51:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 687D067F0C;\n\tTue,  8 Dec 2020 21:51:22 +0100 (CET)",
            "from mail-ed1-x542.google.com (mail-ed1-x542.google.com\n\t[IPv6:2a00:1450:4864:20::542])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BC08F67F07\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Dec 2020 21:51:20 +0100 (CET)",
            "by mail-ed1-x542.google.com with SMTP id q16so18993562edv.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Dec 2020 12:51:20 -0800 (PST)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\td13sm16062688ejc.44.2020.12.08.12.51.18\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 08 Dec 2020 12:51:19 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"aT9mfqYH\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=rl95fGVd+cGJJ0yB5cFcprCZfchUW7zYAEtb8AQUeC8=;\n\tb=aT9mfqYH0bPPQZIrc8IeLTLebmBUwiIEEo0hKZYEfRuqO/rAOeJyiXojMuyM17G0A3\n\tATWSOVlYJttnI9Y5Df77vPaT6uESgMeUz1OGRIUknF53DHZpEbEIWfajOvzLf7ir2bYQ\n\tBhe4QR+xuPpjWAvI3jStwtgk08/R8bWr7s75fChYp+YFclfnC64aKUlhCmT0HZg/wiG9\n\tgBxXr7LwFdLIrhkeEG+F1esPlvObHAt7dqfnRcXm7I+5RSmZSJCeIcjnHnUvB1AWSIJG\n\tH9FjgMSY0MheRDp3UPuAIGxRqYuXKhWeKgBNLdyPYb+2syYznJyOt6KHuPjWDDJxkKjq\n\t0j0w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=rl95fGVd+cGJJ0yB5cFcprCZfchUW7zYAEtb8AQUeC8=;\n\tb=uXpV8gF4B4lgdxO28JunTZvTXu3M//70ku7fO7zj50YofkURPaGRIDN0ypzXO2cIWJ\n\t5k3vEWPx6L4+r4on4wWeo9H+UDUJDjHK8BZufxcC6Ade0JzOCR1xhAp/y89O5BEJ/wE8\n\tTg7sVLbf1Q+dxFnGDCjBcYKHyOYDfw60VLm99jt2cDYHEy2Q//+DllLu3V7bWcOdRNxZ\n\teMA9/z4gc4d/mYJmNq62cBqcqQ3s8O+A6mxkuSzv3atbp3BdVaS4E5sGj6U8K9e8dfAa\n\tK55AkQM0ELR/AVyH4E9lsV8lyRmKo+EU68FXwSvU2RM5KZrJYVmv3WVSW77tE22D5mLs\n\t2ymQ==",
        "X-Gm-Message-State": "AOAM533coM0LZWLUQY6H3fMeT/wNYQh88t7h8n5yVME8230x5Qc6BTOs\n\tztqoxVLwjhM4tlqyIqsPhbgRcMSDfT+teq+3",
        "X-Google-Smtp-Source": "ABdhPJwTEVbihKl+RlTcGZBP1D5G9462PEDHhWbPUvd2fJ0M2CH+ynUpo6+kg6NXuBfg5i59Vtso0w==",
        "X-Received": "by 2002:a05:6402:d0a:: with SMTP id\n\teb10mr26696654edb.305.1607460680090; \n\tTue, 08 Dec 2020 12:51:20 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  8 Dec 2020 20:51:17 +0000",
        "Message-Id": "<20201208205117.22204-1-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH] src: pipeline: raspberrypi: Allow\n\tScalerCrop to work when passed in Camera::start",
        "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>",
        "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": "The ScalerCrop control is handled by the pipeline handler, not the\nIPA, so must be handled explicitly in the Camera::start method. The\nScalerCrop code used when processing requests has been factored out to\nmake it easy to reuse.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 45 ++++++++++++-------\n 1 file changed, 28 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 2ec1f6e7..593fd7ac 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -156,6 +156,7 @@ public:\n \tvoid handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream);\n \tvoid handleExternalBuffer(FrameBuffer *buffer, RPi::Stream *stream);\n \tvoid handleState();\n+\tvoid applyScalerCrop(const ControlList &controls);\n \n \tCameraSensor *sensor_;\n \t/* Array of Unicam and ISP device streams and associated buffers/streams. */\n@@ -751,6 +752,10 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont\n \t\treturn ret;\n \t}\n \n+\t/* Check if a ScalerCrop control was specified. */\n+\tif (controls)\n+\t\tdata->applyScalerCrop(*controls);\n+\n \t/* Start the IPA. */\n \tIPAOperationData ipaData = {};\n \tIPAOperationData result = {};\n@@ -1610,24 +1615,10 @@ void RPiCameraData::checkRequestCompleted()\n \t}\n }\n \n-void RPiCameraData::tryRunPipeline()\n+void RPiCameraData::applyScalerCrop(const ControlList &controls)\n {\n-\tFrameBuffer *bayerBuffer, *embeddedBuffer;\n-\tIPAOperationData op;\n-\n-\t/* If any of our request or buffer queues are empty, we cannot proceed. */\n-\tif (state_ != State::Idle || requestQueue_.empty() ||\n-\t    bayerQueue_.empty() || embeddedQueue_.empty())\n-\t\treturn;\n-\n-\tif (!findMatchingBuffers(bayerBuffer, embeddedBuffer))\n-\t\treturn;\n-\n-\t/* Take the first request from the queue and action the IPA. */\n-\tRequest *request = requestQueue_.front();\n-\n-\tif (request->controls().contains(controls::ScalerCrop)) {\n-\t\tRectangle nativeCrop = request->controls().get<Rectangle>(controls::ScalerCrop);\n+\tif (controls.contains(controls::ScalerCrop)) {\n+\t\tRectangle nativeCrop = controls.get<Rectangle>(controls::ScalerCrop);\n \n \t\tif (!nativeCrop.width || !nativeCrop.height)\n \t\t\tnativeCrop = { 0, 0, 1, 1 };\n@@ -1654,6 +1645,26 @@ void RPiCameraData::tryRunPipeline()\n \t\t\tupdateScalerCrop_ = true;\n \t\t}\n \t}\n+}\n+\n+void RPiCameraData::tryRunPipeline()\n+{\n+\tFrameBuffer *bayerBuffer, *embeddedBuffer;\n+\tIPAOperationData op;\n+\n+\t/* If any of our request or buffer queues are empty, we cannot proceed. */\n+\tif (state_ != State::Idle || requestQueue_.empty() ||\n+\t    bayerQueue_.empty() || embeddedQueue_.empty())\n+\t\treturn;\n+\n+\tif (!findMatchingBuffers(bayerBuffer, embeddedBuffer))\n+\t\treturn;\n+\n+\t/* Take the first request from the queue and action the IPA. */\n+\tRequest *request = requestQueue_.front();\n+\n+\t/* See if a new ScalerCrop value needs to be applied. */\n+\tapplyScalerCrop(request->controls());\n \n \t/*\n \t * Process all the user controls by the IPA. Once this is complete, we\n",
    "prefixes": [
        "libcamera-devel"
    ]
}