Show a patch.

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

{
    "id": 8565,
    "url": "https://patchwork.libcamera.org/api/patches/8565/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8565/",
    "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": "<20200702214009.2129404-1-kieran.bingham@ideasonboard.com>",
    "date": "2020-07-02T21:40:09",
    "name": "[libcamera-devel,RFC/UNTESTED] android: camera_metadata: Track tags of each entry added",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "9b1b61218c1ccf74e247f3248eb9ef7b3a3e5226",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": {
        "id": 11,
        "url": "https://patchwork.libcamera.org/api/users/11/?format=api",
        "username": "kbingham",
        "first_name": "Kieran",
        "last_name": "Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/8565/mbox/",
    "series": [
        {
            "id": 1074,
            "url": "https://patchwork.libcamera.org/api/series/1074/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1074",
            "date": "2020-07-02T21:40:09",
            "name": "[libcamera-devel,RFC/UNTESTED] android: camera_metadata: Track tags of each entry added",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1074/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8565/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8565/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 9FAA3BFFE2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Jul 2020 21:40:14 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 35E4C60C59;\n\tThu,  2 Jul 2020 23:40:14 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 268F7603B4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Jul 2020 23:40:13 +0200 (CEST)",
            "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 96D2E9CB;\n\tThu,  2 Jul 2020 23:40:12 +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=\"SF5MmbN4\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593726012;\n\tbh=6GtpFet9ghgfi2Mzx4j35GnpTc20K7X/RaH3wiOVkqE=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=SF5MmbN4KjYyVB3b+SYGdfurfirc6bqC0ifDStU9jcuJNciiP7YgcNkn+Gkju/RRV\n\tJkHXoY8VryB+io7aiq13qbE11uYsk4comuaCMJoXWKlAnypqO+GPchwX5qGtje859k\n\t7FBV3mh/x3e7l5rsdUgevI3d17/IrjU+SP1mRSq4=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Thu,  2 Jul 2020 22:40:09 +0100",
        "Message-Id": "<20200702214009.2129404-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH][RFC/UNTESTED] android: camera_metadata:\n\tTrack tags of each entry added",
        "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": "Provide automatic tracking of tags added to automatically report the\nkeys used for the entry:\n ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,\n\nThis allows automatic addition of added keys without having to manually\nmaintain the list in the code base.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/android/camera_device.cpp   | 57 ++++-----------------------------\n src/android/camera_metadata.cpp |  4 ++-\n src/android/camera_metadata.h   |  4 +++\n 3 files changed, 13 insertions(+), 52 deletions(-)\n\nSending this, completely untested because ... that's how I roll, and I\nwanted to know if this is a reasonable route to reduce maintainance\nburden.\n\nA next step beyond this is also to consider a two-pass iteration on all\nof the meta-data structures, where the first pass will determine the\nnumber of entries, and bytes required, while the second pass will\nactually populate the android metadata.\n\nAnythoughts on this? It would mean processing the entries twice, but\nwould stop the guessing game of 'is there enough memory allocated\nhere'...",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 5a3b4dfae6a0..de73c31ed3ea 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -721,58 +721,13 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\t\t\t  availableCapabilities.data(),\n \t\t\t\t  availableCapabilities.size());\n \n-\tstd::vector<int32_t> availableCharacteristicsKeys = {\n-\t\tANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,\n-\t\tANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,\n-\t\tANDROID_CONTROL_AE_AVAILABLE_MODES,\n-\t\tANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n-\t\tANDROID_CONTROL_AE_COMPENSATION_RANGE,\n-\t\tANDROID_CONTROL_AE_COMPENSATION_STEP,\n-\t\tANDROID_CONTROL_AF_AVAILABLE_MODES,\n-\t\tANDROID_CONTROL_AVAILABLE_EFFECTS,\n-\t\tANDROID_CONTROL_AVAILABLE_SCENE_MODES,\n-\t\tANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,\n-\t\tANDROID_CONTROL_AWB_AVAILABLE_MODES,\n-\t\tANDROID_CONTROL_MAX_REGIONS,\n-\t\tANDROID_CONTROL_SCENE_MODE_OVERRIDES,\n-\t\tANDROID_CONTROL_AE_LOCK_AVAILABLE,\n-\t\tANDROID_CONTROL_AWB_LOCK_AVAILABLE,\n-\t\tANDROID_CONTROL_AVAILABLE_MODES,\n-\t\tANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,\n-\t\tANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,\n-\t\tANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,\n-\t\tANDROID_SENSOR_INFO_SENSITIVITY_RANGE,\n-\t\tANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,\n-\t\tANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE,\n-\t\tANDROID_SENSOR_ORIENTATION,\n-\t\tANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES,\n-\t\tANDROID_SENSOR_INFO_PHYSICAL_SIZE,\n-\t\tANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,\n-\t\tANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES,\n-\t\tANDROID_STATISTICS_INFO_MAX_FACE_COUNT,\n-\t\tANDROID_SYNC_MAX_LATENCY,\n-\t\tANDROID_FLASH_INFO_AVAILABLE,\n-\t\tANDROID_LENS_INFO_AVAILABLE_APERTURES,\n-\t\tANDROID_LENS_FACING,\n-\t\tANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,\n-\t\tANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,\n-\t\tANDROID_LENS_INFO_HYPERFOCAL_DISTANCE,\n-\t\tANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE,\n-\t\tANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,\n-\t\tANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,\n-\t\tANDROID_SCALER_AVAILABLE_FORMATS,\n-\t\tANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,\n-\t\tANDROID_SCALER_AVAILABLE_STALL_DURATIONS,\n-\t\tANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n-\t\tANDROID_SCALER_CROPPING_TYPE,\n-\t\tANDROID_INFO_SUPPORTED_HARDWARE_LEVEL,\n-\t\tANDROID_REQUEST_PARTIAL_RESULT_COUNT,\n-\t\tANDROID_REQUEST_PIPELINE_MAX_DEPTH,\n-\t\tANDROID_REQUEST_AVAILABLE_CAPABILITIES,\n-\t};\n+\t/*\n+\t * All tags added to staticMetadata_ to this point are added\n+\t * as keys for the available characteristics.\n+\t */\n \tstaticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,\n-\t\t\t\t  availableCharacteristicsKeys.data(),\n-\t\t\t\t  availableCharacteristicsKeys.size());\n+\t\t\t\t  staticMetadata_->tags().data(),\n+\t\t\t\t  staticMetadata_->tags().size());\n \n \tstd::vector<int32_t> availableRequestKeys = {\n \t\tANDROID_CONTROL_AE_MODE,\ndiff --git a/src/android/camera_metadata.cpp b/src/android/camera_metadata.cpp\nindex 47b2e4ef117a..15b569aea52b 100644\n--- a/src/android/camera_metadata.cpp\n+++ b/src/android/camera_metadata.cpp\n@@ -30,8 +30,10 @@ bool CameraMetadata::addEntry(uint32_t tag, const void *data, size_t count)\n \tif (!valid_)\n \t\treturn false;\n \n-\tif (!add_camera_metadata_entry(metadata_, tag, data, count))\n+\tif (!add_camera_metadata_entry(metadata_, tag, data, count)) {\n+\t\ttags_.push_back(tag);\n \t\treturn true;\n+\t}\n \n \tconst char *name = get_camera_metadata_tag_name(tag);\n \tif (name)\ndiff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h\nindex 75a9d7066f31..a0e23119e68f 100644\n--- a/src/android/camera_metadata.h\n+++ b/src/android/camera_metadata.h\n@@ -8,6 +8,7 @@\n #define __ANDROID_CAMERA_METADATA_H__\n \n #include <stdint.h>\n+#include <vector>\n \n #include <system/camera_metadata.h>\n \n@@ -20,10 +21,13 @@ public:\n \tbool isValid() { return valid_; }\n \tbool addEntry(uint32_t tag, const void *data, size_t data_count);\n \n+\tconst std::vector<int32_t> &tags() { return tags_; }\n+\n \tcamera_metadata_t *get();\n \n private:\n \tcamera_metadata_t *metadata_;\n+\tstd::vector<int32_t> tags_;\n \tbool valid_;\n };\n \n",
    "prefixes": [
        "libcamera-devel",
        "RFC/UNTESTED"
    ]
}