Show a patch.

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

{
    "id": 10527,
    "url": "https://patchwork.libcamera.org/api/patches/10527/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10527/",
    "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": "<20201201150056.52378-1-jacopo@jmondi.org>",
    "date": "2020-12-01T15:00:56",
    "name": "[libcamera-devel] android: camera_mode: Resize 'data' vectors",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5748130897f20c3f7182c57422b91ec925688c03",
    "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/10527/mbox/",
    "series": [
        {
            "id": 1495,
            "url": "https://patchwork.libcamera.org/api/series/1495/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1495",
            "date": "2020-12-01T15:00:56",
            "name": "[libcamera-devel] android: camera_mode: Resize 'data' vectors",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1495/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10527/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10527/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 ABB28BE177\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Dec 2020 15:01:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4518A63457;\n\tTue,  1 Dec 2020 16:01:02 +0100 (CET)",
            "from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D9486032D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Dec 2020 16:01:01 +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 relay11.mail.gandi.net (Postfix) with ESMTPSA id 2E89F100002;\n\tTue,  1 Dec 2020 15:00:59 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "hanlinchen@chromium.org,\n\tlibcamera-devel@lists.libcamera.org",
        "Date": "Tue,  1 Dec 2020 16:00:56 +0100",
        "Message-Id": "<20201201150056.52378-1-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.29.1",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH] android: camera_mode: Resize 'data'\n\tvectors",
        "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 CameraDevice::getStaticMetadata() function populates the\nentries for Android's static metadata by walking the ControlInfo\nsupported values reported by the libcamera pipeline.\n\nFor each entry a vector of the size of the maximum number of possible\nentries is reserved, populated and then stored in the Android's metadata\npack.\n\nThe number of actual entries to be passed to Android is computed using\nthe vector's size which, for this reason, shall be resized to the actual\nnumber of entries it stores.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\nThis patch fixes cros_camera_test:\nCamera3DeviceTest/Camera3DeviceDefaultSettings.ConstructDefaultSettings/1\n---\n src/android/camera_device.cpp | 6 ++++++\n 1 file changed, 6 insertions(+)\n\n--\n2.29.1",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex d43db3600b20..d559f0fc4b81 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -602,8 +602,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\tif (infoMap != controlsInfo.end()) {\n \t\t\tfor (const auto &value : infoMap->second.values())\n \t\t\t\tdata.push_back(value.get<int32_t>());\n+\t\t\tdata.resize(infoMap->second.values().size());\n \t\t} else {\n \t\t\tdata.push_back(ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF);\n+\t\t\tdata.resize(1);\n \t\t}\n \t\tstaticMetadata_->addEntry(ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,\n \t\t\t\t\t  data.data(), data.size());\n@@ -803,8 +805,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\tif (infoMap != controlsInfo.end()) {\n \t\t\tfor (const auto &value : infoMap->second.values())\n \t\t\t\tdata.push_back(value.get<int32_t>());\n+\t\t\tdata.resize(infoMap->second.values().size());\n \t\t} else {\n \t\t\tdata.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);\n+\t\t\tdata.resize(1);\n \t\t}\n \t\tstaticMetadata_->addEntry(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES,\n \t\t\t\t\t  data.data(), data.size());\n@@ -871,8 +875,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\tif (infoMap != controlsInfo.end()) {\n \t\t\tfor (const auto &value : infoMap->second.values())\n \t\t\t\tdata.push_back(value.get<int32_t>());\n+\t\t\tdata.resize(infoMap->second.values().size());\n \t\t} else {\n \t\t\tdata.push_back(ANDROID_NOISE_REDUCTION_MODE_OFF);\n+\t\t\tdata.resize(1);\n \t\t}\n \t\tstaticMetadata_->addEntry(ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,\n \t\t\t\t\t  data.data(), data.size());\n",
    "prefixes": [
        "libcamera-devel"
    ]
}