Show a patch.

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

{
    "id": 10934,
    "url": "https://patchwork.libcamera.org/api/patches/10934/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10934/",
    "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": "<20210121165305.367801-7-jacopo@jmondi.org>",
    "date": "2021-01-21T16:53:04",
    "name": "[libcamera-devel,6/7] android: camera_device: Use CameraMetadata in processControls()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "fabd2e1235b13723393fa188970ccac4af869703",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10934/mbox/",
    "series": [
        {
            "id": 1593,
            "url": "https://patchwork.libcamera.org/api/series/1593/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1593",
            "date": "2021-01-21T16:52:58",
            "name": "android: camera device and metadata improvements",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1593/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10934/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10934/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 49318BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Jan 2021 16:53:04 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 08E8968204;\n\tThu, 21 Jan 2021 17:53:04 +0100 (CET)",
            "from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4031568210\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Jan 2021 17:52:59 +0100 (CET)",
            "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id D1B891C0012;\n\tThu, 21 Jan 2021 16:52:58 +0000 (UTC)"
        ],
        "X-Originating-IP": "93.34.118.233",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org,\n\tPaul Elder <paul.elder@ideasonboard.com>",
        "Date": "Thu, 21 Jan 2021 17:53:04 +0100",
        "Message-Id": "<20210121165305.367801-7-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.29.2",
        "In-Reply-To": "<20210121165305.367801-1-jacopo@jmondi.org>",
        "References": "<20210121165305.367801-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 6/7] android: camera_device: Use\n\tCameraMetadata in processControls()",
        "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": "Use the CameraMetadata API to retrieve the values of the request\nassociated settings in CameraDevice::processControls() function.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 15 ++++++---------\n src/android/camera_device.h   |  3 +--\n 2 files changed, 7 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 9733c84612bd..d185fdf7fb2f 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1623,10 +1623,10 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer\n \treturn new FrameBuffer(std::move(planes));\n }\n \n-int CameraDevice::processControls(const camera3_capture_request_t *camera3Request,\n-\t\t\t\t  Camera3RequestDescriptor *descriptor)\n+int CameraDevice::processControls(Camera3RequestDescriptor *descriptor)\n {\n-\tif (!camera3Request->settings)\n+\tconst CameraMetadata &settings = descriptor->settings_;\n+\tif (!settings.isValid())\n \t\treturn 0;\n \n \t/*\n@@ -1635,12 +1635,9 @@ int CameraDevice::processControls(const camera3_capture_request_t *camera3Reques\n \t * \\todo As soon as more controls are handled, this part should be\n \t * broken out to a dedicated function.\n \t */\n-\tconst camera_metadata_t *camera3Settings = camera3Request->settings;\n \tcamera_metadata_ro_entry_t entry;\n-\tint ret = find_camera_metadata_ro_entry(camera3Settings,\n-\t\t\t\t\t\tANDROID_SCALER_CROP_REGION,\n-\t\t\t\t\t\t&entry);\n-\tif (!ret) {\n+\tbool found = settings.getEntry(ANDROID_SCALER_CROP_REGION, &entry);\n+\tif (found) {\n \t\tconst int32_t *data = entry.data.i32;\n \t\tRectangle cropRegion{ data[0], data[1],\n \t\t\t\t      static_cast<unsigned int>(data[2]),\n@@ -1752,7 +1749,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques\n \t * Translate controls from Android to libcamera and queue the request\n \t * to the CameraWorker thread.\n \t */\n-\tint ret = processControls(camera3Request, descriptor);\n+\tint ret = processControls(descriptor);\n \tif (ret)\n \t\treturn ret;\n \ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex bad3be8e8066..597d11fcda2e 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -104,8 +104,7 @@ private:\n \tvoid notifyError(uint32_t frameNumber, camera3_stream_t *stream);\n \tCameraMetadata *requestTemplatePreview();\n \tlibcamera::PixelFormat toPixelFormat(int format) const;\n-\tint processControls(const camera3_capture_request_t *camera3Request,\n-\t\t\t    Camera3RequestDescriptor *descriptor);\n+\tint processControls(Camera3RequestDescriptor *descriptor);\n \tstd::unique_ptr<CameraMetadata> getResultMetadata(\n \t\tCamera3RequestDescriptor *descriptor, int64_t timestamp);\n \n",
    "prefixes": [
        "libcamera-devel",
        "6/7"
    ]
}